Class: Covered::Wrapper

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

Direct Known Subclasses

Capture, Filter, Forks, Include, Persist, Policy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output = Base.new) ⇒ Wrapper

Returns a new instance of Wrapper.



46
47
48
# File 'lib/covered/wrapper.rb', line 46

def initialize(output = Base.new)
	@output = output
end

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output.



50
51
52
# File 'lib/covered/wrapper.rb', line 50

def output
  @output
end

Instance Method Details

#accept?(path) ⇒ Boolean

Returns:

  • (Boolean)


64
65
66
# File 'lib/covered/wrapper.rb', line 64

def accept?(path)
	@output.accept?(path)
end

#add(coverage) ⇒ Object



72
73
74
# File 'lib/covered/wrapper.rb', line 72

def add(coverage)
	@output.add(coverage)
end

#clearObject



56
57
58
# File 'lib/covered/wrapper.rb', line 56

def clear
	@output.clear
end

#each {|Coverage| ... } ⇒ Object

Yields:

  • (Coverage)

    the path to the file, and the execution counts.



77
78
79
# File 'lib/covered/wrapper.rb', line 77

def each(&block)
	@output.each(&block)
end

#expand_path(path) ⇒ Object



85
86
87
# File 'lib/covered/wrapper.rb', line 85

def expand_path(path)
	@output.expand_path(path)
end

#finishObject



60
61
62
# File 'lib/covered/wrapper.rb', line 60

def finish
	@output.finish
end

#mark(path, lineno, value) ⇒ Object



68
69
70
# File 'lib/covered/wrapper.rb', line 68

def mark(path, lineno, value)
	@output.mark(path, lineno, value)
end

#relative_path(path) ⇒ Object



81
82
83
# File 'lib/covered/wrapper.rb', line 81

def relative_path(path)
	@output.relative_path(path)
end

#startObject



52
53
54
# File 'lib/covered/wrapper.rb', line 52

def start
	@output.start
end

#to_hObject



89
90
91
# File 'lib/covered/wrapper.rb', line 89

def to_h
	to_enum(:each).collect{|coverage| [coverage.path, coverage]}.to_h
end