Class: Cybertrain::WebSocket::Connection
- Inherits:
-
Object
- Object
- Cybertrain::WebSocket::Connection
- Defined in:
- cybertrain/websocket.rb
Overview
What a callback uses to talk back on the connection it was called for. Valid only during the call.
Instance Method Summary collapse
-
#close ⇒ nil
Closes the connection (close 1000); the feed reconnects after the retry delay.
-
#last_opcode ⇒ Symbol
The kind of the message on_message was last given.
-
#send_binary(data) ⇒ nil
Sends a binary message.
-
#send_text(text) ⇒ nil
Sends a text message.
Instance Method Details
#close ⇒ nil
Closes the connection (close 1000); the feed reconnects after the retry delay.
84 85 86 |
# File 'cybertrain/websocket.rb', line 84 def close @client.close end |
#last_opcode ⇒ Symbol
The kind of the message on_message was last given.
91 92 93 |
# File 'cybertrain/websocket.rb', line 91 def last_opcode @last_opcode end |
#send_binary(data) ⇒ nil
Sends a binary message.
76 77 78 |
# File 'cybertrain/websocket.rb', line 76 def send_binary(data) @client.send_binary(data) end |
#send_text(text) ⇒ nil
Sends a text message.
68 69 70 |
# File 'cybertrain/websocket.rb', line 68 def send_text(text) @client.send_text(text) end |