Class: Playwright::PlaywrightApi

Inherits:
Object
  • Object
show all
Defined in:
lib/playwright/playwright_api.rb

Defined Under Namespace

Classes: ApiImplementationWrapper, ChannelOwnerWrapper

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(impl) ⇒ PlaywrightApi

Returns a new instance of PlaywrightApi.



100
101
102
# File 'lib/playwright/playwright_api.rb', line 100

def initialize(impl)
  @impl = impl
end

Class Method Details

.wrap(channel_owner_or_api_implementation) ⇒ Object

Note:

Intended for internal use only.

Wrap ChannelOwner / ApiImplementation. Playwright::ChannelOwners::XXXXX will be wrapped as Playwright::XXXXX Playwright::YYYYImpl will be wrapped as Playwright::YYYY Playwright::XXXXX is automatically generated by development/generate_api

Parameters:



10
11
12
13
14
15
16
17
18
19
# File 'lib/playwright/playwright_api.rb', line 10

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

Instance Method Details

#==(other) ⇒ Object



104
105
106
# File 'lib/playwright/playwright_api.rb', line 104

def ==(other)
  @impl.to_s == other.instance_variable_get(:'@impl').to_s
end