Class: FFWD::Core::Emitter

Inherits:
Object
  • Object
show all
Defined in:
lib/ffwd/core/emitter.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event, metric) ⇒ Emitter

Returns a new instance of Emitter.



33
34
35
36
# File 'lib/ffwd/core/emitter.rb', line 33

def initialize event, metric
  @event = event
  @metric = metric
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



25
26
27
# File 'lib/ffwd/core/emitter.rb', line 25

def event
  @event
end

#metricObject (readonly)

Returns the value of attribute metric.



25
26
27
# File 'lib/ffwd/core/emitter.rb', line 25

def metric
  @metric
end

Class Method Details

.build(output, opts = {}) ⇒ Object



27
28
29
30
31
# File 'lib/ffwd/core/emitter.rb', line 27

def self.build output, opts={}
  event = EventEmitter.build output, opts, opts[:event] || {}
  metric = MetricEmitter.build output, opts, opts[:metric] || {}
  new(event, metric)
end