Module: Horizon::Handler

Extended by:
ActiveSupport::Concern
Defined in:
lib/horizon/handler.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#events_handledObject



21
22
23
# File 'lib/horizon/handler.rb', line 21

def events_handled
  self.class.events_handled
end

#handle(event, *args) ⇒ Object



29
30
31
32
33
# File 'lib/horizon/handler.rb', line 29

def handle(event, *args)
  self.class.handlers[event].each do |handler|
    handler.call self, *args
  end
end

#handlersObject



25
26
27
# File 'lib/horizon/handler.rb', line 25

def handlers
  @handlers ||= curry_handlers
end