Class: Tinker::Application
- Includes:
- Reactor
- Defined in:
- lib/tinker/application.rb
Instance Attribute Summary
Attributes included from Reactor
Attributes inherited from Engine
Instance Method Summary collapse
-
#initialize ⇒ Application
constructor
A new instance of Application.
- #on_client_join(event) ⇒ Object
- #on_client_leave(event) ⇒ Object
Methods included from Reactor
#clients, #run, #stop, #trap_sigint
Methods included from Evented
Methods inherited from Engine
Methods included from Context
Constructor Details
#initialize ⇒ Application
Returns a new instance of Application.
7 8 9 10 |
# File 'lib/tinker/application.rb', line 7 def initialize super Tinker.application ||= self end |
Instance Method Details
#on_client_join(event) ⇒ Object
12 13 14 |
# File 'lib/tinker/application.rb', line 12 def on_client_join(event) add_client(event.environment.client) end |
#on_client_leave(event) ⇒ Object
16 17 18 |
# File 'lib/tinker/application.rb', line 16 def on_client_leave(event) event.environment.client.disconnect end |