Class: Selenium::DevTools::V85::DeviceOrientation

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/devtools/v85/device_orientation.rb

Instance Method Summary collapse

Constructor Details

#initialize(devtools) ⇒ DeviceOrientation

Returns a new instance of DeviceOrientation.



26
27
28
# File 'lib/selenium/devtools/v85/device_orientation.rb', line 26

def initialize(devtools)
  @devtools = devtools
end

Instance Method Details

#clear_device_orientation_overrideObject



35
36
37
# File 'lib/selenium/devtools/v85/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/v85/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/v85/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