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.



22
23
24
25
26
27
28
29
# File 'lib/playwright/playwright_api.rb', line 22

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



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

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