Class: Selenium::WebDriver::Interactions::PointerInput Private
- Inherits:
-
InputDevice
- Object
- InputDevice
- Selenium::WebDriver::Interactions::PointerInput
- Defined in:
- rb/lib/selenium/webdriver/common/interactions/pointer_input.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.
Creates actions specific to Pointer Input devices
Constant Summary collapse
- KIND =
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.
{mouse: :mouse, pen: :pen, touch: :touch}.freeze
Instance Attribute Summary collapse
- #kind ⇒ Object readonly private
Attributes inherited from InputDevice
Instance Method Summary collapse
- #assert_kind(pointer) ⇒ Object private
- #create_pointer_cancel ⇒ Object private
- #create_pointer_down(button, **opts) ⇒ Object private
- #create_pointer_move(duration: 0, x: 0, y: 0, origin: nil, **opts) ⇒ Object private
- #create_pointer_up(button, **opts) ⇒ Object private
- #encode ⇒ Object private
-
#initialize(kind, name: nil) ⇒ PointerInput
constructor
private
A new instance of PointerInput.
Methods inherited from InputDevice
#add_action, #clear_actions, #create_pause
Constructor Details
#initialize(kind, name: nil) ⇒ PointerInput
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 PointerInput.
34 35 36 37 38 |
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 34 def initialize(kind, name: nil) super(name) @kind = assert_kind(kind) @type = Interactions::POINTER end |
Instance Attribute Details
#kind ⇒ Object (readonly)
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.
32 33 34 |
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 32 def kind @kind end |
Instance Method Details
#assert_kind(pointer) ⇒ Object
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.
46 47 48 49 50 |
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 46 def assert_kind(pointer) raise TypeError, "#{pointer.inspect} is not a valid pointer type" unless KIND.key? pointer KIND[pointer] end |
#create_pointer_cancel ⇒ Object
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.
64 65 66 |
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 64 def create_pointer_cancel add_action(PointerCancel.new(self)) end |
#create_pointer_down(button, **opts) ⇒ Object
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.
56 57 58 |
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 56 def create_pointer_down(, **opts) add_action(PointerPress.new(self, :down, , **opts)) end |
#create_pointer_move(duration: 0, x: 0, y: 0, origin: nil, **opts) ⇒ Object
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 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 52 def create_pointer_move(duration: 0, x: 0, y: 0, origin: nil, **opts) add_action(PointerMove.new(self, duration, x, y, origin: origin, **opts)) end |
#create_pointer_up(button, **opts) ⇒ Object
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.
60 61 62 |
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 60 def create_pointer_up(, **opts) add_action(PointerPress.new(self, :up, , **opts)) end |
#encode ⇒ Object
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.
40 41 42 43 44 |
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 40 def encode output = super output[:parameters] = {pointerType: kind} if output output end |