Class: Playwright::Channel
- Inherits:
-
Object
- Object
- Playwright::Channel
- Includes:
- EventEmitter
- Defined in:
- lib/playwright/channel.rb
Instance Attribute Summary collapse
-
#guid ⇒ Object
readonly
Returns the value of attribute guid.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
- #async_send_message_to_server(method, params = {}) ⇒ Object
-
#initialize(connection, guid, object:) ⇒ Channel
constructor
A new instance of Channel.
- #send_message_to_server(method, params = {}) ⇒ Playwright::ChannelOwner|nil
- #send_message_to_server_result(method, params) ⇒ Hash
Methods included from EventEmitter
Constructor Details
#initialize(connection, guid, object:) ⇒ Channel
Returns a new instance of Channel.
8 9 10 11 12 |
# File 'lib/playwright/channel.rb', line 8 def initialize(connection, guid, object:) @connection = connection @guid = guid @object = object end |
Instance Attribute Details
#guid ⇒ Object (readonly)
Returns the value of attribute guid.
14 15 16 |
# File 'lib/playwright/channel.rb', line 14 def guid @guid end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
14 15 16 |
# File 'lib/playwright/channel.rb', line 14 def object @object end |
Instance Method Details
#async_send_message_to_server(method, params = {}) ⇒ Object
41 42 43 44 45 46 47 |
# File 'lib/playwright/channel.rb', line 41 def (method, params = {}) with_logging do || @connection.(@guid, method, params, metadata: ) end nil end |
#send_message_to_server(method, params = {}) ⇒ Playwright::ChannelOwner|nil
19 20 21 22 23 24 25 26 27 |
# File 'lib/playwright/channel.rb', line 19 def (method, params = {}) result = (method, params) if result.is_a?(Hash) _type, channel_owner = result.first channel_owner else nil end end |
#send_message_to_server_result(method, params) ⇒ Hash
32 33 34 35 36 |
# File 'lib/playwright/channel.rb', line 32 def (method, params) with_logging do || @connection.(@guid, method, params, metadata: ) end end |