Class: Coverage::HTMLPrinter::Line
- Inherits:
-
Object
- Object
- Coverage::HTMLPrinter::Line
- Includes:
- ERB::Util
- Defined in:
- lib/coverage/html_printer.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
Returns the value of attribute count.
-
#lineno ⇒ Object
Returns the value of attribute lineno.
Instance Method Summary collapse
- #class_name ⇒ Object
-
#initialize(lineno, line, count) ⇒ Line
constructor
A new instance of Line.
- #line ⇒ Object
Constructor Details
#initialize(lineno, line, count) ⇒ Line
Returns a new instance of Line.
222 223 224 225 226 |
# File 'lib/coverage/html_printer.rb', line 222 def initialize(lineno, line, count) @lineno = lineno @line = line @count = count end |
Instance Attribute Details
#count ⇒ Object
Returns the value of attribute count.
220 221 222 |
# File 'lib/coverage/html_printer.rb', line 220 def count @count end |
#lineno ⇒ Object
Returns the value of attribute lineno.
220 221 222 |
# File 'lib/coverage/html_printer.rb', line 220 def lineno @lineno end |
Instance Method Details
#class_name ⇒ Object
233 234 235 236 237 238 239 240 241 242 243 244 |
# File 'lib/coverage/html_printer.rb', line 233 def class_name case when @count.nil? 'not-code' when @count > 0 'covered' when @count == 0 'uncovered' else raise "must not happen! count=<#{@count}>" end end |
#line ⇒ Object
228 229 230 231 |
# File 'lib/coverage/html_printer.rb', line 228 def line return "‌\n" if @line.chomp.size == 0 h(@line).gsub(/ /, ' ') end |