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!
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)
-
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
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