Class: Covered::Root
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from Wrapper
Instance Method Summary collapse
- #expand_path(path) ⇒ Object
-
#initialize(output, path) ⇒ Root
constructor
A new instance of Root.
- #match?(path) ⇒ Boolean
- #relative_path(path) ⇒ Object
Methods inherited from Filter
Methods inherited from Wrapper
#accept?, #add, #clear, #each, #finish, #mark, #start, #to_h
Methods inherited from Base
#accept?, #add, #clear, #each, #finish, #mark, #start
Constructor Details
#initialize(output, path) ⇒ Root
Returns a new instance of Root.
129 130 131 132 133 |
# File 'lib/covered/files.rb', line 129 def initialize(output, path) super(output) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
135 136 137 |
# File 'lib/covered/files.rb', line 135 def path @path end |
Instance Method Details
#expand_path(path) ⇒ Object
137 138 139 |
# File 'lib/covered/files.rb', line 137 def (path) File.(super, @path) end |
#match?(path) ⇒ Boolean
149 150 151 |
# File 'lib/covered/files.rb', line 149 def match?(path) path.start_with?(@path) end |
#relative_path(path) ⇒ Object
141 142 143 144 145 146 147 |
# File 'lib/covered/files.rb', line 141 def relative_path(path) if path.start_with?(@path) path.slice(@path.size+1, path.size) else super end end |