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.



31
32
33
34
# File 'lib/ffwd/core/emitter.rb', line 31

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

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



23
24
25
# File 'lib/ffwd/core/emitter.rb', line 23

def event
  @event
end

#metricObject (readonly)

Returns the value of attribute metric.



23
24
25
# File 'lib/ffwd/core/emitter.rb', line 23

def metric
  @metric
end

Class Method Details

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



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

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