class Coverage::Statistics

Attributes

counts[R]
path[R]

Public Class Methods

new(path, counts) click to toggle source
# File lib/coverage/statistics.rb, line 6
def initialize(path, counts)
  @path = path
  @counts = counts
end

Public Instance Methods

code_coverage() click to toggle source
# File lib/coverage/statistics.rb, line 23
def code_coverage
  "%.2f" % [(lines_of_covered_code / lines_of_code.to_f) * 100]
end
lines_of_code() click to toggle source
# File lib/coverage/statistics.rb, line 15
def lines_of_code
  counts.compact.size
end
lines_of_covered_code() click to toggle source
# File lib/coverage/statistics.rb, line 27
def lines_of_covered_code
  counts.select{|count| count && count > 0 }.size
end
total() click to toggle source
# File lib/coverage/statistics.rb, line 11
def total
  counts.size
end
total_coverage() click to toggle source
# File lib/coverage/statistics.rb, line 19
def total_coverage
  "%.2f" % [(lines_of_covered_code / total.to_f) * 100]
end