class Selenium::WebDriver::Interactions::PointerPress
def assert_button(button)
def assert_button(button) if button.is_a? Symbol raise TypeError, "#{button.inspect} is not a valid button!" unless BUTTONS.key? button button = BUTTONS[button] end raise ArgumentError, 'Button number cannot be negative!' unless button >= 0 button end
def assert_direction(direction)
def assert_direction(direction) raise TypeError, "#{direction.inspect} is not a valid button direction" unless DIRECTIONS.key? direction DIRECTIONS[direction] end
def encode
def encode {type: type, button: @button} end
def initialize(source, direction, button)
def initialize(source, direction, button) super(source) @direction = assert_direction(direction) @button = assert_button(button) end
def type
def type @direction end