Class: Selenium::DevTools::V131::DeviceOrientation
- Inherits:
-
Object
- Object
- Selenium::DevTools::V131::DeviceOrientation
- Defined in:
- lib/selenium/devtools/v131/device_orientation.rb
Instance Method Summary collapse
- #clear_device_orientation_override ⇒ Object
-
#initialize(devtools) ⇒ DeviceOrientation
constructor
A new instance of DeviceOrientation.
- #on(event, &block) ⇒ Object
- #set_device_orientation_override(alpha:, beta:, gamma:) ⇒ Object
Constructor Details
#initialize(devtools) ⇒ DeviceOrientation
Returns a new instance of DeviceOrientation.
26 27 28 |
# File 'lib/selenium/devtools/v131/device_orientation.rb', line 26 def initialize(devtools) @devtools = devtools end |
Instance Method Details
#clear_device_orientation_override ⇒ Object
35 36 37 |
# File 'lib/selenium/devtools/v131/device_orientation.rb', line 35 def clear_device_orientation_override @devtools.send_cmd('DeviceOrientation.clearDeviceOrientationOverride') end |
#on(event, &block) ⇒ Object
30 31 32 33 |
# File 'lib/selenium/devtools/v131/device_orientation.rb', line 30 def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["DeviceOrientation.#{event}"] << block end |
#set_device_orientation_override(alpha:, beta:, gamma:) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/selenium/devtools/v131/device_orientation.rb', line 39 def set_device_orientation_override(alpha:, beta:, gamma:) @devtools.send_cmd('DeviceOrientation.setDeviceOrientationOverride', alpha: alpha, beta: beta, gamma: gamma) end |