Class: Playwright::PlaywrightApi::ChannelOwnerWrapper

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

Instance Method Summary collapse

Constructor Details

#initialize(impl) ⇒ ChannelOwnerWrapper

Returns a new instance of ChannelOwnerWrapper.



33
34
35
36
37
38
39
40
# File 'lib/playwright/playwright_api.rb', line 33

def initialize(impl)
  impl_class_name = impl.class.name
  unless impl_class_name.include?("::ChannelOwners::")
    raise "#{impl_class_name} is not ChannelOwners"
  end

  @impl = impl
end

Instance Method Details

#wrapObject



42
43
44
45
46
47
48
49
# File 'lib/playwright/playwright_api.rb', line 42

def wrap
  api_class = detect_class_for(@impl.class)
  if api_class
    @impl._api ||= api_class.new(@impl)
  else
    raise NotImplementedError.new("Playwright::#{expected_class_name_for(@impl.class)} is not implemented")
  end
end