module Covered::Ratio

def complete?

@returns [Boolean] Whether `executed_count` equals `executable_count`.
Whether all executable lines were executed.
def complete?
	executed_count == executable_count
end

def percentage

@returns [Numeric] The coverage ratio multiplied by `100`.
The coverage ratio as a percentage.
def percentage
	ratio * 100
end

def ratio

@returns [Rational | Float] The executed-to-executable line ratio, or `1.0` when there are no executable lines.
The fraction of executable lines that were executed.
def ratio
	return 1.0 if executable_count.zero?
	
	Rational(executed_count, executable_count)
end