Class: Capybara::Chrome::RDPWebSocketClient

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/chrome/rdp_web_socket_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ RDPWebSocketClient

Returns a new instance of RDPWebSocketClient.



5
6
7
8
9
10
11
12
13
14
# File 'lib/capybara/chrome/rdp_web_socket_client.rb', line 5

def initialize(url)
  @socket = RDPSocket.new(url)
  @driver = ::WebSocket::Driver.client(socket)

  @messages = []
  @status = :closed

  setup_driver
  start_driver
end

Instance Attribute Details

#driverObject (readonly)

Returns the value of attribute driver.



3
4
5
# File 'lib/capybara/chrome/rdp_web_socket_client.rb', line 3

def driver
  @driver
end

#messagesObject (readonly)

Returns the value of attribute messages.



3
4
5
# File 'lib/capybara/chrome/rdp_web_socket_client.rb', line 3

def messages
  @messages
end

#socketObject (readonly)

Returns the value of attribute socket.



3
4
5
# File 'lib/capybara/chrome/rdp_web_socket_client.rb', line 3

def socket
  @socket
end

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/capybara/chrome/rdp_web_socket_client.rb', line 3

def status
  @status
end

Instance Method Details

#parse_inputObject



20
21
22
# File 'lib/capybara/chrome/rdp_web_socket_client.rb', line 20

def parse_input
  @driver.parse(@socket.read)
end

#send_msg(msg) ⇒ Object



16
17
18
# File 'lib/capybara/chrome/rdp_web_socket_client.rb', line 16

def send_msg(msg)
  driver.text msg
end