Class: Rake::Coverage::Summary

Inherits:
Object
  • Object
show all
Defined in:
lib/test/rake/coverage_summary.rb

Overview

data objects for erb binding ———————————–

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ Summary

Returns a new instance of Summary.



116
117
118
119
120
121
122
# File 'lib/test/rake/coverage_summary.rb', line 116

def initialize( filename )
  @filename = filename
  @total_lines = 0
  @covered_lines = 0
  @lines = []
  @seen = []
end

Instance Attribute Details

#covered_linesObject

Returns the value of attribute covered_lines.



114
115
116
# File 'lib/test/rake/coverage_summary.rb', line 114

def covered_lines
  @covered_lines
end

#filenameObject

Returns the value of attribute filename.



114
115
116
# File 'lib/test/rake/coverage_summary.rb', line 114

def filename
  @filename
end

#linesObject

Returns the value of attribute lines.



115
116
117
# File 'lib/test/rake/coverage_summary.rb', line 115

def lines
  @lines
end

#seenObject

Returns the value of attribute seen.



115
116
117
# File 'lib/test/rake/coverage_summary.rb', line 115

def seen
  @seen
end

#total_linesObject

Returns the value of attribute total_lines.



114
115
116
# File 'lib/test/rake/coverage_summary.rb', line 114

def total_lines
  @total_lines
end

Instance Method Details

#get_bindingObject



129
130
131
# File 'lib/test/rake/coverage_summary.rb', line 129

def get_binding
  binding
end

#htmlfileObject



126
127
128
# File 'lib/test/rake/coverage_summary.rb', line 126

def htmlfile
  @filename.gsub(/[\.\/]/, '_') + ".html"
end

#pctObject



123
124
125
# File 'lib/test/rake/coverage_summary.rb', line 123

def pct
  @covered_lines.to_f / @total_lines.to_f
end