Class: Reportier::Reporter

Inherits:
Object
  • Object
show all
Defined in:
lib/reportier/reporter.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(reporters) ⇒ Reporter

Returns a new instance of Reporter.



9
10
11
# File 'lib/reportier/reporter.rb', line 9

def initialize(reporters)
  @reporters = reporters
end

Instance Attribute Details

#reportersObject

Returns the value of attribute reporters.



3
4
5
# File 'lib/reportier/reporter.rb', line 3

def reporters
  @reporters
end

Class Method Details

.getObject



5
6
7
# File 'lib/reportier/reporter.rb', line 5

def self.get
  @current ||= new(Defaults.global.reporters)
end

Instance Method Details

#call(tracker, &blk) ⇒ Object



13
14
15
16
17
# File 'lib/reportier/reporter.rb', line 13

def call(tracker, &blk)
  @reporters.each do |reporter, v|
    eval "to_#{Namer.new.name(reporter)} \"#{blk.call}\""
  end
end