Class: SurrealDB::Connections::WebSocket::SocketWrapper

Inherits:
Object
  • Object
show all
Defined in:
lib/surrealdb/connections/websocket.rb

Overview

Minimal wrapper that gives websocket-driver the interface it expects: #url for the request URL, and #write for sending bytes.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(socket, url) ⇒ SocketWrapper

Returns a new instance of SocketWrapper.



298
299
300
301
# File 'lib/surrealdb/connections/websocket.rb', line 298

def initialize(socket, url)
  @socket = socket
  @url = url
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



296
297
298
# File 'lib/surrealdb/connections/websocket.rb', line 296

def url
  @url
end

Instance Method Details

#write(data) ⇒ Object



303
304
305
# File 'lib/surrealdb/connections/websocket.rb', line 303

def write(data)
  @socket.write(data)
end