Class: Applitools::MouseTrigger

Inherits:
Object
  • Object
show all
Defined in:
lib/eyes_selenium_ruby/eyes/mouse_trigger.rb

Constant Summary collapse

MouseAction =
{ click: 1, right_click: 2,  double_click: 3,  move: 4,  down: 5,  up: 6 }

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mouse_action, control, location) ⇒ MouseTrigger

Returns a new instance of MouseTrigger.



7
8
9
10
11
# File 'lib/eyes_selenium_ruby/eyes/mouse_trigger.rb', line 7

def initialize(mouse_action, control, location)
  @mouse_action = MouseAction[mouse_action]
  @control = control
  @location = location
end

Instance Attribute Details

#controlObject (readonly)

Returns the value of attribute control.



5
6
7
# File 'lib/eyes_selenium_ruby/eyes/mouse_trigger.rb', line 5

def control
  @control
end

#locationObject (readonly)

Returns the value of attribute location.



5
6
7
# File 'lib/eyes_selenium_ruby/eyes/mouse_trigger.rb', line 5

def location
  @location
end

#mouse_actionObject (readonly)

Returns the value of attribute mouse_action.



5
6
7
# File 'lib/eyes_selenium_ruby/eyes/mouse_trigger.rb', line 5

def mouse_action
  @mouse_action
end

Instance Method Details

#to_hashObject



13
14
15
16
17
18
# File 'lib/eyes_selenium_ruby/eyes/mouse_trigger.rb', line 13

def to_hash
  {
    "$type" => "Applitools.Models.MouseTrigger, Core", mouseAction: mouse_action,
    control: control.to_hash, location: Hash[location.each_pair.to_a]
  }
end