Class: Yoda::Server::LifecycleHandler
- Inherits:
-
Object
- Object
- Yoda::Server::LifecycleHandler
- Defined in:
- lib/yoda/server/lifecycle_handler.rb
Overview
Handle
Instance Attribute Summary collapse
- #notifier ⇒ Notifier readonly
- #session ⇒ Session? readonly
Instance Method Summary collapse
- #handle(method:, params:) ⇒ Object
- #handle?(method) ⇒ true, false
-
#initialize(root_handler) ⇒ LifecycleHandler
constructor
A new instance of LifecycleHandler.
Constructor Details
#initialize(root_handler) ⇒ LifecycleHandler
Returns a new instance of LifecycleHandler.
13 14 15 16 |
# File 'lib/yoda/server/lifecycle_handler.rb', line 13 def initialize(root_handler) @root_handler = root_handler @notifier = root_handler.notifier end |
Instance Attribute Details
#notifier ⇒ Notifier (readonly)
11 12 13 |
# File 'lib/yoda/server/lifecycle_handler.rb', line 11 def notifier @notifier end |
#session ⇒ Session? (readonly)
8 9 10 |
# File 'lib/yoda/server/lifecycle_handler.rb', line 8 def session @session end |
Instance Method Details
#handle(method:, params:) ⇒ Object
26 27 28 |
# File 'lib/yoda/server/lifecycle_handler.rb', line 26 def handle(method:, params:) lifecycle_handlers[method].call(params) end |
#handle?(method) ⇒ true, false
20 21 22 |
# File 'lib/yoda/server/lifecycle_handler.rb', line 20 def handle?(method) lifecycle_handlers.key?(method) end |