Module: Faye::WebSocket::Client::Connection
- Defined in:
- lib/faye/websocket/client.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #connection_completed ⇒ Object
- #receive_data(data) ⇒ Object
- #unbind(error = nil) ⇒ Object
- #write(data) ⇒ Object
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
75 76 77 |
# File 'lib/faye/websocket/client.rb', line 75 def parent @parent end |
Instance Method Details
#connection_completed ⇒ Object
77 78 79 |
# File 'lib/faye/websocket/client.rb', line 77 def connection_completed parent.__send__(:on_connect, self) end |
#receive_data(data) ⇒ Object
81 82 83 |
# File 'lib/faye/websocket/client.rb', line 81 def receive_data(data) parent.__send__(:parse, data) end |
#unbind(error = nil) ⇒ Object
85 86 87 88 |
# File 'lib/faye/websocket/client.rb', line 85 def unbind(error = nil) parent.__send__(:emit_error, error) if error parent.__send__(:finalize_close) end |
#write(data) ⇒ Object
90 91 92 |
# File 'lib/faye/websocket/client.rb', line 90 def write(data) send_data(data) rescue nil end |