Module: Covered::Ratio

Included in:
Coverage, Statistics
Defined in:
lib/covered/coverage.rb

Instance Method Summary collapse

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)

29
30
31
# File 'lib/covered/coverage.rb', line 29

def complete?
	executed_count == executable_count
end

#percentageObject


33
34
35
# File 'lib/covered/coverage.rb', line 33

def percentage
	ratio * 100
end

#ratioObject


23
24
25
26
27
# File 'lib/covered/coverage.rb', line 23

def ratio
	return 1 if executable_count.zero?
	
	Rational(executed_count, executable_count)
end