class Playwright::PlaywrightApi
def self.unwrap(api)
- Note: - Intended for internal use only.
def self.unwrap(api) case api when PlaywrightApi api.instance_variable_get(:@impl) else api end end
def self.wrap(channel_owner_or_api_implementation)
- Note: - Intended for internal use only.
Parameters:
-
channel_owner
(ChannelOwner|ApiImplementation
) --
def self.wrap(channel_owner_or_api_implementation) case channel_owner_or_api_implementation when ChannelOwner ChannelOwnerWrapper.new(channel_owner_or_api_implementation).wrap when ApiImplementation ApiImplementationWrapper.new(channel_owner_or_api_implementation).wrap else channel_owner_or_api_implementation end end
def initialize(impl)
-
impl
(Playwright::ChannelOwner|Playwright::ApiImplementation
) --
def initialize(impl) @impl = impl end
def unwrap_impl(object, visited: {})
def unwrap_impl(object, visited: {}) ect.is_a?(Array) ss visited[object] sited[object] = [] ject.each { |obj| visited[object] << unwrap_impl(obj) } ted[object] object.is_a?(Hash) ss visited[object] sited[object] = {} ject.each do |key, obj| visited[object][key] = unwrap_impl(obj, visited: visited) d ted[object] object.is_a?(PlaywrightApi) aywright::PlaywrightApi.unwrap(object) ct
def wrap_block_call(block)
-
block
(Proc
) --
def wrap_block_call(block) nil unless block.is_a?(Proc) rgs) { ped_args = args.map { |arg| wrap_impl(arg) } k.call(*wrapped_args)
def wrap_impl(object, visited: {})
def wrap_impl(object, visited: {}) ect.is_a?(Array) ss visited[object] sited[object] = [] ject.each { |obj| visited[object] << wrap_impl(obj) } ted[object] object.is_a?(Hash) ss visited[object] sited[object] = {} ject.each do |key, obj| visited[object][key] = wrap_impl(obj, visited: visited) d ted[object] aywright::PlaywrightApi.wrap(object)