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 = {}) ⇒ Object
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
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/playwright/channel.rb', line 24 def (method, params = {}) @connection.(@guid, method, params).then do |result| if result.is_a?(Hash) _type, channel_owner = result.first channel_owner else nil end end end |
#send_message_to_server(method, params = {}) ⇒ Object
18 19 20 |
# File 'lib/playwright/channel.rb', line 18 def (method, params = {}) (method, params).value! end |