Class: Covered::Wrapper

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

Direct Known Subclasses

Capture, Files, Filter, Include, Policy, Source, Statistics, Summary

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

#outputObject (readonly)

Returns the value of attribute output.



29
30
31
# File 'lib/covered/wrapper.rb', line 29

def output
  @output
end

Instance Method Details

#disableObject



39
40
41
# File 'lib/covered/wrapper.rb', line 39

def disable
	@output.disable if @output
end

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

Yields:

  • (Coverage)

    the path to the file, and the execution counts.



44
45
46
# File 'lib/covered/wrapper.rb', line 44

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

#enableObject



35
36
37
# File 'lib/covered/wrapper.rb', line 35

def enable
	@output.enable if @output
end

#mark(*args) ⇒ Object



31
32
33
# File 'lib/covered/wrapper.rb', line 31

def mark(*args)
	@output.mark(*args) if @output
end

#to_hObject



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

def to_h
	collect{|coverage| [coverage.path, coverage]}.to_h
end