Class: Covered::Filter
Overview
Filters coverage before forwarding it to another output.
Instance Attribute Summary
Attributes inherited from Wrapper
Instance Method Summary collapse
-
#accept?(path) ⇒ Boolean
Whether the given path is accepted by this filter and its output.
- #each {|Coverage| ... } ⇒ Object
-
#mark(path, lineno, value) ⇒ Object
Mark coverage if the path is accepted by this filter.
-
#match?(path) ⇒ Boolean
Whether the given path matches this filter.
Methods inherited from Wrapper
#add, #clear, #expand_path, #finish, #initialize, #relative_path, #start, #to_h
Methods inherited from Base
#add, #clear, #expand_path, #finish, #relative_path, #start
Constructor Details
This class inherits a constructor from Covered::Wrapper
Instance Method Details
#accept?(path) ⇒ Boolean
Whether the given path is accepted by this filter and its output.
154 155 156 |
# File 'lib/covered/wrapper.rb', line 154 def accept?(path) match?(path) and super end |
#each {|Coverage| ... } ⇒ Object
145 146 147 148 149 |
# File 'lib/covered/wrapper.rb', line 145 def each(&block) @output.each do |coverage| yield coverage if accept?(coverage.path) end end |
#mark(path, lineno, value) ⇒ Object
Mark coverage if the path is accepted by this filter.
140 141 142 |
# File 'lib/covered/wrapper.rb', line 140 def mark(path, lineno, value) @output.mark(path, lineno, value) if accept?(path) end |
#match?(path) ⇒ Boolean
Whether the given path matches this filter.
161 162 163 |
# File 'lib/covered/wrapper.rb', line 161 def match?(path) true end |