123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::Interactions::PointerMove Private

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

Overview

Action related to moving the pointer.

Constant Summary

PointerEventProperties - Included

VALID

Class Method Summary

Instance Attribute Summary

Interaction - Inherited

Instance Method Summary

Constructor Details

.new(source, duration, x, y, **opts) ⇒ PointerMove

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_move.rb', line 36

def initialize(source, duration, x, y, **opts)
  super(source)
  @duration = duration * 1000
  @x_offset = x
  @y_offset = y
  @origin = opts.delete(:element) || opts.delete(:origin) || :viewport
  @type = :pointerMove
  @opts = opts
end

Instance Method Details

#assert_source(source)

Raises:

  • (TypeError)
[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_move.rb', line 46

def assert_source(source)
  raise TypeError, "#{source.type} is not a valid input type" unless source.is_a? PointerInput
end

#encode

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/interactions/pointer_move.rb', line 50

def encode
  process_opts.merge('type' => type.to_s,
                     'duration' => @duration.to_i,
                     'x' => @x_offset,
                     'y' => @y_offset,
                     'origin' => @origin)
end