Class: Covered::Files
Instance Attribute Summary collapse
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
Attributes inherited from Wrapper
Instance Method Summary collapse
- #each(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(output = nil) ⇒ Files
constructor
A new instance of Files.
- #mark(path, *args) ⇒ Object
Methods inherited from Wrapper
#disable, #enable, #expand_path, #relative_path, #to_h
Constructor Details
#initialize(output = nil) ⇒ Files
Returns a new instance of Files.
27 28 29 30 31 |
# File 'lib/covered/files.rb', line 27 def initialize(output = nil) super(output) @paths = {} end |
Instance Attribute Details
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
33 34 35 |
# File 'lib/covered/files.rb', line 33 def paths @paths end |
Instance Method Details
#each(&block) ⇒ Object
47 48 49 |
# File 'lib/covered/files.rb', line 47 def each(&block) @paths.each_value(&block) end |
#empty? ⇒ Boolean
35 36 37 |
# File 'lib/covered/files.rb', line 35 def empty? @paths.empty? end |
#mark(path, *args) ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/covered/files.rb', line 39 def mark(path, *args) coverage = (@paths[path] ||= Coverage.new(path)) coverage.mark(*args) return coverage end |