Class: Deskbot::Event::MouseMove
- Inherits:
-
Event
- Object
- Event
- Deskbot::Event::MouseMove
- Defined in:
- lib/deskbot/event.rb
Overview
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Class Method Summary collapse
Instance Method Summary collapse
-
#coords ⇒ Object
Returns the mouse position as
[x, y]. -
#initialize(x:, y:, recorded_at:) ⇒ MouseMove
constructor
rubocop:disable Naming/MethodParameterName.
Constructor Details
#initialize(x:, y:, recorded_at:) ⇒ MouseMove
rubocop:disable Naming/MethodParameterName
115 116 117 118 119 |
# File 'lib/deskbot/event.rb', line 115 def initialize(x:, y:, recorded_at:) # rubocop:disable Naming/MethodParameterName @x = x @y = y @recorded_at = recorded_at end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
113 114 115 |
# File 'lib/deskbot/event.rb', line 113 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
113 114 115 |
# File 'lib/deskbot/event.rb', line 113 def y @y end |
Class Method Details
.build(payload) ⇒ Object
121 122 123 124 125 126 127 |
# File 'lib/deskbot/event.rb', line 121 def self.build(payload) new( x: payload["x"], y: payload["y"], recorded_at: recorded_at_from(payload) ) end |
Instance Method Details
#coords ⇒ Object
Returns the mouse position as [x, y].
130 131 132 |
# File 'lib/deskbot/event.rb', line 130 def coords [x, y] end |