Class: Covered::Wrapper
- Inherits:
-
Object
show all
- Includes:
- Enumerable
- Defined in:
- lib/covered/wrapper.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(output = nil) ⇒ Wrapper
Returns a new instance of Wrapper.
25
26
27
|
# File 'lib/covered/wrapper.rb', line 25
def initialize(output = nil)
@output = output
end
|
Instance Attribute Details
#output ⇒ Object
Returns the value of attribute output.
29
30
31
|
# File 'lib/covered/wrapper.rb', line 29
def output
@output
end
|
Instance Method Details
#disable ⇒ Object
39
40
41
|
# File 'lib/covered/wrapper.rb', line 39
def disable
@output.disable if @output
end
|
#each {|Coverage| ... } ⇒ Object
44
45
46
|
# File 'lib/covered/wrapper.rb', line 44
def each(&block)
@output.each(&block) if @output
end
|
#enable ⇒ Object
35
36
37
|
# File 'lib/covered/wrapper.rb', line 35
def enable
@output.enable if @output
end
|
#expand_path(path) ⇒ Object
56
57
58
59
60
61
62
|
# File 'lib/covered/wrapper.rb', line 56
def expand_path(path)
if @output
@output.expand_path(path)
else
path
end
end
|
#mark(*args) ⇒ Object
31
32
33
|
# File 'lib/covered/wrapper.rb', line 31
def mark(*args)
@output.mark(*args) if @output
end
|
#relative_path(path) ⇒ Object
48
49
50
51
52
53
54
|
# File 'lib/covered/wrapper.rb', line 48
def relative_path(path)
if @output
@output.relative_path(path)
else
path
end
end
|
#to_h ⇒ Object
64
65
66
|
# File 'lib/covered/wrapper.rb', line 64
def to_h
collect{|coverage| [coverage.path, coverage]}.to_h
end
|