class Playwright::Channel

Attributes

guid[R]
object[R]

Public Class Methods

new(connection, guid, object:) click to toggle source

@param connection [Playwright::Connection] @param guid [String] @param object [Playwright::ChannelOwner]

# File lib/playwright/channel.rb, line 8
def initialize(connection, guid, object:)
  @connection = connection
  @guid = guid
  @object = object
end

Public Instance Methods

async_send_message_to_server(method, params = {}) click to toggle source

@param method [String] @param params [Hash] @returns nil

# File lib/playwright/channel.rb, line 39
def async_send_message_to_server(method, params = {})
  @connection.async_send_message_to_server(@guid, method, params)

  nil
end
send_message_to_server(method, params = {}) click to toggle source

@param method [String] @param params [Hash] @return [Playwright::ChannelOwner|nil]

# File lib/playwright/channel.rb, line 19
def send_message_to_server(method, params = {})
  result = send_message_to_server_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) click to toggle source

@param method [String] @param params [Hash] @return [Hash]

# File lib/playwright/channel.rb, line 32
def send_message_to_server_result(method, params)
  @connection.send_message_to_server(@guid, method, params)
end