Class: Playwright::PlaywrightApi::ApiImplementationWrapper
- Inherits:
-
Object
- Object
- Playwright::PlaywrightApi::ApiImplementationWrapper
- Defined in:
- lib/playwright/playwright_api.rb
Instance Method Summary collapse
-
#initialize(impl) ⇒ ApiImplementationWrapper
constructor
A new instance of ApiImplementationWrapper.
- #wrap ⇒ Object
Constructor Details
#initialize(impl) ⇒ ApiImplementationWrapper
Returns a new instance of ApiImplementationWrapper.
63 64 65 66 67 68 69 70 |
# File 'lib/playwright/playwright_api.rb', line 63 def initialize(impl) impl_class_name = impl.class.name unless impl_class_name.end_with?("Impl") raise "#{impl_class_name} is not Impl" end @impl = impl end |
Instance Method Details
#wrap ⇒ Object
72 73 74 75 76 77 78 79 |
# File 'lib/playwright/playwright_api.rb', line 72 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 |