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.
140 141 142 143 144 |
# File 'lib/covered/files.rb', line 140 def initialize(output, path) super(output) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
146 147 148 |
# File 'lib/covered/files.rb', line 146 def path @path end |
Instance Method Details
#accept?(path) ⇒ Boolean
160 161 162 |
# File 'lib/covered/files.rb', line 160 def accept?(path) path.start_with?(@path) end |
#expand_path(path) ⇒ Object
148 149 150 |
# File 'lib/covered/files.rb', line 148 def (path) File.(super, @path) end |
#relative_path(path) ⇒ Object
152 153 154 155 156 157 158 |
# File 'lib/covered/files.rb', line 152 def relative_path(path) if path.start_with?(@path) path.slice(@path.size+1, path.size) else super end end |