Class: Playwright::PlaywrightApi
- Inherits:
-
Object
- Object
- Playwright::PlaywrightApi
- Defined in:
- lib/playwright/playwright_api.rb
Direct Known Subclasses
APIRequest, APIRequestContext, APIResponse, Accessibility, Android, AndroidDevice, AndroidInput, AndroidSocket, AndroidWebView, Browser, BrowserContext, BrowserType, CDPSession, ConsoleMessage, Dialog, Download, FileChooser, Frame, FrameLocator, JSHandle, Keyboard, Locator, Mouse, Page, Playwright, Request, Response, Route, Selectors, Touchscreen, Tracing, WebSocket, Worker
Defined Under Namespace
Classes: ApiImplementationWrapper, ChannelOwnerWrapper
Class Method Summary collapse
-
.unwrap(api) ⇒ Object
Unwrap ChannelOwner / ApiImplementation.
-
.wrap(channel_owner_or_api_implementation) ⇒ Object
Wrap ChannelOwner / ApiImplementation.
Instance Method Summary collapse
-
#initialize(impl) ⇒ PlaywrightApi
constructor
A new instance of PlaywrightApi.
Constructor Details
#initialize(impl) ⇒ PlaywrightApi
Returns a new instance of PlaywrightApi.
111 112 113 |
# File 'lib/playwright/playwright_api.rb', line 111 def initialize(impl) @impl = impl end |
Class Method Details
.unwrap(api) ⇒ Object
Intended for internal use only.
Unwrap ChannelOwner / ApiImplementation.
23 24 25 26 27 28 29 30 |
# File 'lib/playwright/playwright_api.rb', line 23 def self.unwrap(api) case api when PlaywrightApi api.instance_variable_get(:@impl) else api end end |
.wrap(channel_owner_or_api_implementation) ⇒ Object
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
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 channel_owner_or_api_implementation end end |