Class: Covered::Cache
Instance Attribute Summary
Attributes inherited from Wrapper
Instance Method Summary collapse
- #disable ⇒ Object
- #enable ⇒ Object
- #flush ⇒ Object
-
#initialize(output) ⇒ Cache
constructor
A new instance of Cache.
- #mark(path, lineno, count = 1) ⇒ Object
Methods inherited from Wrapper
Constructor Details
#initialize(output) ⇒ Cache
Returns a new instance of Cache.
51 52 53 54 |
# File 'lib/covered/capture.rb', line 51 def initialize(output) super(output) @marks = [] end |
Instance Method Details
#disable ⇒ Object
72 73 74 75 76 |
# File 'lib/covered/capture.rb', line 72 def disable super flush end |
#enable ⇒ Object
60 61 62 |
# File 'lib/covered/capture.rb', line 60 def enable super end |
#flush ⇒ Object
64 65 66 67 68 69 70 |
# File 'lib/covered/capture.rb', line 64 def flush @marks.each_slice(3) do |path, lineno, count| @output.mark(path, lineno, count) end @marks.clear end |
#mark(path, lineno, count = 1) ⇒ Object
56 57 58 |
# File 'lib/covered/capture.rb', line 56 def mark(path, lineno, count = 1) @marks << path << lineno << count end |