class Selenium::WebDriver::Interactions::PointerPress
Actions related to clicking, tapping or pressing the pointer.
@api private
Constants
- BUTTONS
- DIRECTIONS
Public Class Methods
new(source, direction, button, **opts)
click to toggle source
Calls superclass method
Selenium::WebDriver::Interactions::Interaction::new
# File lib/selenium/webdriver/common/interactions/pointer_press.rb, line 44 def initialize(source, direction, button, **opts) super(source) @direction = assert_direction(direction) @button = assert_button(button) @type = @direction @opts = opts end
Public Instance Methods
encode()
click to toggle source
# File lib/selenium/webdriver/common/interactions/pointer_press.rb, line 52 def encode process_opts.merge('type' => type.to_s, 'button' => @button) end
Private Instance Methods
assert_direction(direction)
click to toggle source
# File lib/selenium/webdriver/common/interactions/pointer_press.rb, line 77 def assert_direction(direction) raise ArgumentError, "#{direction.inspect} is not a valid button direction" unless DIRECTIONS.key? direction DIRECTIONS[direction] end
assert_source(source)
click to toggle source
# File lib/selenium/webdriver/common/interactions/pointer_press.rb, line 58 def assert_source(source) raise TypeError, "#{source.type} is not a valid input type" unless source.is_a? PointerInput end