class Playwright::ChannelOwner

def self.from(channel)

def self.from(channel)
  channel.object
end

def self.from_nullable(channel)

def self.from_nullable(channel)
  channel&.object
end

def after_initialize

def after_initialize

def delete_object_from_child(guid)

def delete_object_from_child(guid)
ts.delete(guid)

def dispose!

used only from Connection. Not intended for public use. So keep private.
def dispose!
n up from parent and connection.
t&.send(:delete_object_from_child, @guid)
ction.send(:delete_object_from_channel_owner, @guid)
ose all children.
ts.each_value { |object| object.send(:dispose!) }
ts.clear

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
  after_initialize
end

def inspect

Suppress long long inspect log and avoid RSpec from hanging up...
def inspect
  to_s
end

def to_s

def to_s
  "#<#{@guid}>"
end

def update_object_from_child(guid, child)

def update_object_from_child(guid, child)
ts[guid] = child