Class: TUB::UpgradableConnection
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- TUB::UpgradableConnection
- Defined in:
- lib/tub/upgradable_connection.rb
Instance Attribute Summary collapse
-
#handler ⇒ Object
Returns the value of attribute handler.
Instance Method Summary collapse
Instance Attribute Details
#handler ⇒ Object
Returns the value of attribute handler.
32 33 34 |
# File 'lib/tub/upgradable_connection.rb', line 32 def handler @handler end |
Instance Method Details
#post_init ⇒ Object
34 35 36 37 |
# File 'lib/tub/upgradable_connection.rb', line 34 def post_init @handler = UpgradableConnection.initial_handler_class.new @signature @upgraded = false end |
#receive_data(data) ⇒ Object
39 40 41 |
# File 'lib/tub/upgradable_connection.rb', line 39 def receive_data(data) @handler.receive_data(data) end |
#unbind ⇒ Object
43 44 45 |
# File 'lib/tub/upgradable_connection.rb', line 43 def unbind @handler.unbind end |
#upgrade! ⇒ Object
47 48 49 50 51 |
# File 'lib/tub/upgradable_connection.rb', line 47 def upgrade! return if @upgraded @handler = UpgradableConnection.upgraded_handler_class.new @signature @upgraded = true end |