Class: RailwayIpc::HandlerStore
- Inherits:
-
Object
- Object
- RailwayIpc::HandlerStore
- Defined in:
- lib/railway_ipc/handler_store.rb
Instance Attribute Summary collapse
-
#handler_map ⇒ Object
readonly
Returns the value of attribute handler_map.
Instance Method Summary collapse
- #get(response_message) ⇒ Object
-
#initialize ⇒ HandlerStore
constructor
A new instance of HandlerStore.
- #register(message:, handler:) ⇒ Object
- #registered ⇒ Object
Constructor Details
#initialize ⇒ HandlerStore
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_map ⇒ Object (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() handler_map[] end |
#register(message:, handler:) ⇒ Object
16 17 18 |
# File 'lib/railway_ipc/handler_store.rb', line 16 def register(message:, handler:) handler_map[.to_s] = HandlerManifest.new(, handler) end |
#registered ⇒ Object
12 13 14 |
# File 'lib/railway_ipc/handler_store.rb', line 12 def registered handler_map.keys end |