class Playwright::ChannelOwner

def initialize(parent, type, guid, initializer)

Parameters:
  • initializer (Hash) --
  • guid (String) --
  • type (String) --
  • parent (Playwright::ChannelOwner|Playwright::Connection) --
def initialize(parent, type, guid, initializer)
  @objects = {}
  if parent.is_a?(ChannelOwner)
    @connection = parent.instance_variable_get(:@connection)
    @connection.send(:update_object_from_channel_owner, guid, self)
    @parent = parent
    @parent.send(:update_object_from_child, guid, self)
  elsif parent.is_a?(Connection)
    @connection = parent
    @connection.send(:update_object_from_channel_owner, guid, self)
  else
    raise ArgumentError.new('parent must be an instance of Playwright::ChannelOwner or Playwright::Connection')
  end
  @channel = Channel.new(@connection, guid, object: self)
  @type = type
  @guid = guid
  @initializer = initializer
  @event_to_subscription_mapping = {}
  after_initialize
end