Class: Rake::Coverage::Summary
- Inherits:
-
Object
- Object
- Rake::Coverage::Summary
- Defined in:
- lib/test/rake/coverage_summary.rb
Overview
data objects for erb binding ———————————–
Instance Attribute Summary collapse
-
#covered_lines ⇒ Object
Returns the value of attribute covered_lines.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#seen ⇒ Object
Returns the value of attribute seen.
-
#total_lines ⇒ Object
Returns the value of attribute total_lines.
Instance Method Summary collapse
- #get_binding ⇒ Object
- #htmlfile ⇒ Object
-
#initialize(filename) ⇒ Summary
constructor
A new instance of Summary.
- #pct ⇒ Object
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_lines ⇒ Object
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 |
#filename ⇒ Object
Returns the value of attribute filename.
114 115 116 |
# File 'lib/test/rake/coverage_summary.rb', line 114 def filename @filename end |
#lines ⇒ Object
Returns the value of attribute lines.
115 116 117 |
# File 'lib/test/rake/coverage_summary.rb', line 115 def lines @lines end |
#seen ⇒ Object
Returns the value of attribute seen.
115 116 117 |
# File 'lib/test/rake/coverage_summary.rb', line 115 def seen @seen end |
#total_lines ⇒ Object
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_binding ⇒ Object
129 130 131 |
# File 'lib/test/rake/coverage_summary.rb', line 129 def get_binding binding end |
#htmlfile ⇒ Object
126 127 128 |
# File 'lib/test/rake/coverage_summary.rb', line 126 def htmlfile @filename.gsub(/[\.\/]/, '_') + ".html" end |
#pct ⇒ Object
123 124 125 |
# File 'lib/test/rake/coverage_summary.rb', line 123 def pct @covered_lines.to_f / @total_lines.to_f end |