Class: Capybara::Chrome::RDPWebSocketClient
- Inherits:
-
Object
- Object
- Capybara::Chrome::RDPWebSocketClient
- Defined in:
- lib/capybara/chrome/rdp_web_socket_client.rb
Instance Attribute Summary collapse
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(url) ⇒ RDPWebSocketClient
constructor
A new instance of RDPWebSocketClient.
- #parse_input ⇒ Object
- #send_msg(msg) ⇒ Object
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
#driver ⇒ Object (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 |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
3 4 5 |
# File 'lib/capybara/chrome/rdp_web_socket_client.rb', line 3 def @messages end |
#socket ⇒ Object (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 |
#status ⇒ Object (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_input ⇒ Object
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 |