Class: Dommy::ScreenOrientation
- Inherits:
-
Object
- Object
- Dommy::ScreenOrientation
- Includes:
- Bridge::Methods
- Defined in:
- lib/dommy/screen.rb
Overview
screen.orientation — the ScreenOrientation interface. Reports a fixed
orientation from the viewport aspect ratio; lock/unlock are no-ops (a
headless browser cannot rotate), lock still returning a resolved Promise so
callers that await screen.orientation.lock(...) proceed.
Instance Method Summary collapse
- #__js_call__(method, _args) ⇒ Object
- #__js_get__(key) ⇒ Object
- #__js_set__(_key, _value) ⇒ Object
-
#initialize(window) ⇒ ScreenOrientation
constructor
A new instance of ScreenOrientation.
Methods included from Bridge::Methods
Constructor Details
#initialize(window) ⇒ ScreenOrientation
Returns a new instance of ScreenOrientation.
59 60 61 |
# File 'lib/dommy/screen.rb', line 59 def initialize(window) @window = window end |
Instance Method Details
#__js_call__(method, _args) ⇒ Object
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/dommy/screen.rb', line 80 def __js_call__(method, _args) case method when "lock" PromiseValue.resolve(@window, nil) when "unlock", "addEventListener", "removeEventListener" nil when "dispatchEvent" true end end |