Class: Processor::EventsRegistrator

Inherits:
Object
  • Object
show all
Defined in:
lib/processor/events_registrator.rb

Instance Method Summary collapse

Constructor Details

#initialize(observers) ⇒ EventsRegistrator

Returns a new instance of EventsRegistrator.



3
4
5
# File 'lib/processor/events_registrator.rb', line 3

def initialize(observers)
  @observers = observers
end

Instance Method Details

#register(event, *data) ⇒ Object



7
8
9
10
11
# File 'lib/processor/events_registrator.rb', line 7

def register(event, *data)
  observers.each do |observer|
    observer.update event, *data
  end
end