Class: Covered::Root
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from Wrapper
Instance Method Summary collapse
- #accept?(path) ⇒ Boolean
- #expand_path(path) ⇒ Object
-
#initialize(output, path) ⇒ Root
constructor
A new instance of Root.
- #relative_path(path) ⇒ Object
Methods inherited from Filter
Methods inherited from Wrapper
#disable, #each, #enable, #mark, #to_h
Constructor Details
#initialize(output, path) ⇒ Root
Returns a new instance of Root.
145 146 147 148 149 |
# File 'lib/covered/files.rb', line 145 def initialize(output, path) super(output) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
151 152 153 |
# File 'lib/covered/files.rb', line 151 def path @path end |
Instance Method Details
#accept?(path) ⇒ Boolean
165 166 167 |
# File 'lib/covered/files.rb', line 165 def accept?(path) path.start_with?(@path) end |
#expand_path(path) ⇒ Object
153 154 155 |
# File 'lib/covered/files.rb', line 153 def (path) File.(super, @path) end |
#relative_path(path) ⇒ Object
157 158 159 160 161 162 163 |
# File 'lib/covered/files.rb', line 157 def relative_path(path) if path.start_with?(@path) path[@path.size+1..-1] else super end end |