Module: Selenium::WebDriver::Interactions::PointerEventProperties

Included in:
PointerMove, PointerPress
Defined in:
rb/lib/selenium/webdriver/common/interactions/pointer_event_properties.rb

Constant Summary collapse

VALID =
{width: {'width' => {min: 0.0}},
height: {'height' => {min: 0.0}},
pressure: {'pressure' => {min: 0.0, max: 1.0}},
tangential_pressure: {'tangentialPressure' => {min: -1.0, max: 1.0}},
tilt_x: {'tiltX' => {min: -90, max: 90}},
tilt_y: {'tiltY' => {min: -90, max: 90}},
twist: {'twist' => {min: 0, max: 359}},
altitude_angle: {'altitudeAngle' => {min: 0.0, max: (Math::PI / 2)}},
azimuth_angle: {'azimuthAngle' => {min: 0.0, max: (Math::PI * 2)}}}.freeze

Instance Method Summary collapse

Instance Method Details

#process_optsObject

Raises:

  • (ArgumentError)


34
35
36
37
38
39
40
41
42
43
44
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_event_properties.rb', line 34

def process_opts
  raise ArgumentError, "Unknown options found: #{@opts.inspect}" unless (@opts.keys - VALID.keys).empty?

  VALID.each_with_object({}) do |(key, val), hash|
    next unless @opts.key?(key)

    name = val.keys.first
    values = val.values.first
    hash[name] = assert_number(@opts[key], values[:min], values[:max])
  end
end