Class: Covered::Wrapper

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

Direct Known Subclasses

Cache, Capture, Filter, Include, Persist, Policy, Source, Statistics

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output = Base.new) ⇒ Wrapper

Returns a new instance of Wrapper.



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

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

Instance Attribute Details

#outputObject (readonly)

Returns the value of attribute output.



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

def output
  @output
end

Instance Method Details

#accept?(path) ⇒ Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/covered/wrapper.rb', line 70

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

#disableObject



62
63
64
# File 'lib/covered/wrapper.rb', line 62

def disable
	@output.disable
end

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

Yields:

  • (Coverage)

    the path to the file, and the execution counts.



79
80
81
# File 'lib/covered/wrapper.rb', line 79

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

#enableObject



58
59
60
# File 'lib/covered/wrapper.rb', line 58

def enable
	@output.enable
end

#expand_path(path) ⇒ Object



87
88
89
# File 'lib/covered/wrapper.rb', line 87

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

#flushObject



66
67
68
# File 'lib/covered/wrapper.rb', line 66

def flush
	@output.flush
end

#mark(path, lineno, value) ⇒ Object



74
75
76
# File 'lib/covered/wrapper.rb', line 74

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

#relative_path(path) ⇒ Object



83
84
85
# File 'lib/covered/wrapper.rb', line 83

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

#to_hObject



91
92
93
# File 'lib/covered/wrapper.rb', line 91

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