Class: Finlight::BaseWebSocketClient::DriverSocket
- Inherits:
-
Object
- Object
- Finlight::BaseWebSocketClient::DriverSocket
- Defined in:
- lib/finlight/websocket/base_client.rb
Overview
Adapter between websocket-driver and the raw socket.
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, io) ⇒ DriverSocket
constructor
A new instance of DriverSocket.
- #write(data) ⇒ Object
Constructor Details
#initialize(url, io) ⇒ DriverSocket
Returns a new instance of DriverSocket.
37 38 39 40 |
# File 'lib/finlight/websocket/base_client.rb', line 37 def initialize(url, io) @url = url @io = io end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
35 36 37 |
# File 'lib/finlight/websocket/base_client.rb', line 35 def url @url end |
Instance Method Details
#write(data) ⇒ Object
42 43 44 45 46 |
# File 'lib/finlight/websocket/base_client.rb', line 42 def write(data) @io.write(data) rescue StandardError # The connection is going down; the read loop notices independently. end |