Class: Selenium::WebDriver::Interactions::PointerPress Private

Inherits:
Interaction
  • Object
show all
Includes:
PointerEventProperties
Defined in:
lib/selenium/webdriver/common/interactions/pointer_press.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Actions related to clicking, tapping or pressing the pointer.

Constant Summary collapse

BUTTONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{left: 0,
touch: 0,
pen_contact: 0,
middle: 1,
right: 2,
pen_barrel: 2,
x1: 3,
back: 3,
x2: 4,
forward: 4}.freeze
DIRECTIONS =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

{down: :pointerDown, up: :pointerUp}.freeze

Constants included from PointerEventProperties

Selenium::WebDriver::Interactions::PointerEventProperties::VALID

Instance Attribute Summary

Attributes inherited from Interaction

#type

Instance Method Summary collapse

Methods included from PointerEventProperties

#process_opts

Constructor Details

#initialize(source, direction, button, **opts) ⇒ PointerPress

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of PointerPress.



44
45
46
47
48
49
50
# 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

Instance Method Details

#encodeObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



52
53
54
# File 'lib/selenium/webdriver/common/interactions/pointer_press.rb', line 52

def encode
  process_opts.merge('type' => type.to_s, 'button' => @button)
end