Class: Covered::Files

Inherits:
Base
  • Object
show all
Defined in:
lib/covered/files.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#accept?, #disable, #enable, #expand_path, #relative_path

Constructor Details

#initializeFiles

Returns a new instance of Files.


28
29
30
31
32
# File 'lib/covered/files.rb', line 28

def initialize(*)
	super
	
	@paths = {}
end

Instance Attribute Details

#pathsObject (readonly)

Returns the value of attribute paths


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

def paths
  @paths
end

Instance Method Details

#each(&block) ⇒ Object


48
49
50
# File 'lib/covered/files.rb', line 48

def each(&block)
	@paths.each_value(&block)
end

#empty?Boolean

Returns:

  • (Boolean)

36
37
38
# File 'lib/covered/files.rb', line 36

def empty?
	@paths.empty?
end

#mark(path, lineno, value) ⇒ Object


40
41
42
43
44
45
46
# File 'lib/covered/files.rb', line 40

def mark(path, lineno, value)
	coverage = (@paths[path] ||= Coverage.new(path))
	
	coverage.mark(lineno, value)
	
	return coverage
end