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.
74 75 76 77 78 79 80 81 |
# File 'lib/playwright/playwright_api.rb', line 74 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
83 84 85 86 87 88 89 90 |
# File 'lib/playwright/playwright_api.rb', line 83 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 |