123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::Interactions::PointerInput Private

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, InputDevice
Instance Chain:
self, InputDevice
Inherits: Selenium::WebDriver::Interactions::InputDevice
Defined in: rb/lib/selenium/webdriver/common/interactions/pointer_input.rb

Overview

Creates actions specific to Pointer Input devices

Constant Summary

Class Method Summary

InputDevice - Inherited

Instance Attribute Summary

  • #kind readonly Internal use only

InputDevice - Inherited

Instance Method Summary

Constructor Details

.new(kind, name: nil) ⇒ PointerInput

[ GitHub ]

  
# 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 (readonly)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 32

attr_reader :kind

Instance Method Details

#assert_kind(pointer)

Raises:

  • (TypeError)
[ GitHub ]

  
# 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

[ GitHub ]

  
# 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)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 56

def create_pointer_down(button, **opts)
  add_action(PointerPress.new(self, :down, button, **opts))
end

#create_pointer_move(duration: 0, x: 0, y: 0, origin: nil, **opts)

[ GitHub ]

  
# 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)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 60

def create_pointer_up(button, **opts)
  add_action(PointerPress.new(self, :up, button, **opts))
end

#encode

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_input.rb', line 40

def encode
  output = super
  output[:parameters] = {pointerType: kind} if output
  output
end