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.
101 102 103 |
# File 'cybertrain/websocket.rb', line 101 def close @client.close end |
#last_opcode ⇒ Symbol
The kind of the message on_message was last given.
108 109 110 |
# File 'cybertrain/websocket.rb', line 108 def last_opcode @last_opcode end |
#send_binary(data) ⇒ nil
Sends a binary message.
93 94 95 |
# File 'cybertrain/websocket.rb', line 93 def send_binary(data) @client.send_binary(data) end |
#send_text(text) ⇒ nil
Sends a text message.
85 86 87 |
# File 'cybertrain/websocket.rb', line 85 def send_text(text) @client.send_text(text) end |