Class: Covered::Files

Inherits:
Wrapper show all
Defined in:
lib/covered/files.rb

Instance Attribute Summary collapse

Attributes inherited from Wrapper

#output

Instance Method Summary collapse

Methods inherited from Wrapper

#disable, #enable, #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

#pathsObject (readonly)

Returns the value of attribute paths.



33
34
35
# File 'lib/covered/files.rb', line 33

def paths
  @paths
end

Instance Method Details

#eachObject



47
48
49
50
51
52
53
# File 'lib/covered/files.rb', line 47

def each
	return to_enum unless block_given?
	
	@paths.each do |path, coverage|
		yield coverage
	end
end

#empty?Boolean

Returns:

  • (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