Class: Selenium::WebDriver::BiDi::Transport Private
- Inherits:
-
Object
- Object
- Selenium::WebDriver::BiDi::Transport
- Defined in:
- lib/selenium/webdriver/bidi/transport.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
The seam between the generated Protocol layer and the websocket: serializes a command's params, sends it, and parses the reply into its declared type.
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
private
The websocket the transport sends over.
Instance Method Summary collapse
- #execute(cmd:, params: nil, result: nil) ⇒ Object private
-
#initialize(connection) ⇒ Transport
constructor
private
A new instance of Transport.
Constructor Details
#initialize(connection) ⇒ Transport
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Transport.
33 34 35 |
# File 'lib/selenium/webdriver/bidi/transport.rb', line 33 def initialize(connection) @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The websocket the transport sends over. Exposed so a domain can build a sibling domain (e.g. a vendor variant) over the same connection without Transport ever becoming a public constructor argument.
31 32 33 |
# File 'lib/selenium/webdriver/bidi/transport.rb', line 31 def connection @connection end |
Instance Method Details
#execute(cmd:, params: nil, result: nil) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 40 41 42 43 |
# File 'lib/selenium/webdriver/bidi/transport.rb', line 37 def execute(cmd:, params: nil, result: nil) reply = @connection.send_cmd(method: cmd, params: serialize(params)) raise error_for(reply) if reply['error'] value = reply['result'] result ? result.from_json(value) : value end |