Class: RubyAsterisk::ARI::WebSocket::SocketAdapter
- Inherits:
-
Object
- Object
- RubyAsterisk::ARI::WebSocket::SocketAdapter
- Defined in:
- lib/ruby-asterisk/ari/websocket/socket_adapter.rb
Overview
Minimal socket wrapper handed to WebSocket::Driver.client: the driver reads #url to build the handshake request (including Basic auth from the URL userinfo) and calls #write to emit outgoing bytes.
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, io) ⇒ SocketAdapter
constructor
A new instance of SocketAdapter.
- #write(data) ⇒ Object
Constructor Details
#initialize(url, io) ⇒ SocketAdapter
Returns a new instance of SocketAdapter.
12 13 14 15 |
# File 'lib/ruby-asterisk/ari/websocket/socket_adapter.rb', line 12 def initialize(url, io) @url = url @io = io end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
10 11 12 |
# File 'lib/ruby-asterisk/ari/websocket/socket_adapter.rb', line 10 def url @url end |
Instance Method Details
#write(data) ⇒ Object
17 18 19 |
# File 'lib/ruby-asterisk/ari/websocket/socket_adapter.rb', line 17 def write(data) @io.write(data) end |