Class: Applitools::Base::MouseTrigger
- Inherits:
-
Object
- Object
- Applitools::Base::MouseTrigger
- Defined in:
- lib/applitools/base/mouse_trigger.rb
Constant Summary collapse
- MOUSE_ACTION =
{ click: 'Click', right_click: 'RightClick', double_click: 'DoubleClick', move: 'Move', down: 'Down', up: 'Up' }.freeze
Instance Attribute Summary collapse
-
#control ⇒ Object
readonly
Returns the value of attribute control.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#mouse_action ⇒ Object
readonly
Returns the value of attribute mouse_action.
Instance Method Summary collapse
-
#initialize(mouse_action, control, location) ⇒ MouseTrigger
constructor
A new instance of MouseTrigger.
- #to_hash ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(mouse_action, control, location) ⇒ MouseTrigger
Returns a new instance of MouseTrigger.
14 15 16 17 18 |
# File 'lib/applitools/base/mouse_trigger.rb', line 14 def initialize(mouse_action, control, location) @mouse_action = mouse_action @control = control @location = location end |
Instance Attribute Details
#control ⇒ Object (readonly)
Returns the value of attribute control.
12 13 14 |
# File 'lib/applitools/base/mouse_trigger.rb', line 12 def control @control end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
12 13 14 |
# File 'lib/applitools/base/mouse_trigger.rb', line 12 def location @location end |
#mouse_action ⇒ Object (readonly)
Returns the value of attribute mouse_action.
12 13 14 |
# File 'lib/applitools/base/mouse_trigger.rb', line 12 def mouse_action @mouse_action end |
Instance Method Details
#to_hash ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/applitools/base/mouse_trigger.rb', line 20 def to_hash { trigget_type: 'Mouse', mouse_action: MOUSE_ACTION[mouse_action], control: control.to_hash, location: location.to_hash } end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/applitools/base/mouse_trigger.rb', line 29 def to_s "#{mouse_action} [#{control}] #{location.x}, #{location.y}" end |