Class: RubySlime::EventRouter

Inherits:
Object
  • Object
show all
Includes:
Internals::EventMetadataHandler
Defined in:
lib/ruby_slime/event_router.rb

Instance Method Summary collapse

Constructor Details

#initialize(handlers_map = {}) ⇒ EventRouter

Returns a new instance of EventRouter.



7
8
9
10
# File 'lib/ruby_slime/event_router.rb', line 7

def initialize(handlers_map = {})
  @handlers_map = handlers_map
  freeze
end

Instance Method Details

#call(event, **metadata) ⇒ Object



12
13
14
15
16
# File 'lib/ruby_slime/event_router.rb', line 12

def call(event, **)
  handler = @handlers_map[event.class]
  return unless handler
  handle_handler_arguments(handler, event, )
end