Class: RailwayIpc::HandlerStore

Inherits:
Object
  • Object
show all
Defined in:
lib/railway_ipc/handler_store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHandlerStore

Returns a new instance of HandlerStore.



8
9
10
# File 'lib/railway_ipc/handler_store.rb', line 8

def initialize
  @handler_map = {}
end

Instance Attribute Details

#handler_mapObject (readonly)

Returns the value of attribute handler_map.



6
7
8
# File 'lib/railway_ipc/handler_store.rb', line 6

def handler_map
  @handler_map
end

Instance Method Details

#get(response_message) ⇒ Object



20
21
22
# File 'lib/railway_ipc/handler_store.rb', line 20

def get(response_message)
  handler_map[response_message]
end

#register(message:, handler:) ⇒ Object



16
17
18
# File 'lib/railway_ipc/handler_store.rb', line 16

def register(message:, handler:)
  handler_map[message.to_s] = HandlerManifest.new(message, handler)
end

#registeredObject



12
13
14
# File 'lib/railway_ipc/handler_store.rb', line 12

def registered
  handler_map.keys
end