Class: Covered::Capture
Instance Attribute Summary
Attributes inherited from Wrapper
Instance Method Summary collapse
- #disable ⇒ Object
- #enable ⇒ Object
-
#initialize(output) ⇒ Capture
constructor
A new instance of Capture.
Methods inherited from Wrapper
#each, #expand_path, #mark, #relative_path, #to_h
Constructor Details
#initialize(output) ⇒ Capture
Returns a new instance of Capture.
27 28 29 30 31 32 33 34 35 |
# File 'lib/covered/capture.rb', line 27 def initialize(output) super(output) @trace = TracePoint.new(:line, :call) do |event| if path = event.path @output.mark(path, event.lineno) end end end |
Instance Method Details
#disable ⇒ Object
43 44 45 46 47 |
# File 'lib/covered/capture.rb', line 43 def disable @trace.disable super end |
#enable ⇒ Object
37 38 39 40 41 |
# File 'lib/covered/capture.rb', line 37 def enable super @trace.enable end |