Class: Ruflet::Events::LongPressEndEvent
- Inherits:
-
BasePayload
- Object
- BasePayload
- Ruflet::Events::LongPressEndEvent
- Defined in:
- lib/ruflet_ui/ruflet/events/gesture_events.rb
Instance Attribute Summary collapse
-
#global_position ⇒ Object
readonly
Returns the value of attribute global_position.
-
#local_position ⇒ Object
readonly
Returns the value of attribute local_position.
-
#velocity ⇒ Object
readonly
Returns the value of attribute velocity.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(local_position:, global_position:, velocity:) ⇒ LongPressEndEvent
constructor
A new instance of LongPressEndEvent.
Methods inherited from BasePayload
duration, offset, pick, stringify_keys
Constructor Details
#initialize(local_position:, global_position:, velocity:) ⇒ LongPressEndEvent
Returns a new instance of LongPressEndEvent.
184 185 186 187 188 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 184 def initialize(local_position:, global_position:, velocity:) @local_position = local_position @global_position = global_position @velocity = velocity end |
Instance Attribute Details
#global_position ⇒ Object (readonly)
Returns the value of attribute global_position.
182 183 184 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 182 def global_position @global_position end |
#local_position ⇒ Object (readonly)
Returns the value of attribute local_position.
182 183 184 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 182 def local_position @local_position end |
#velocity ⇒ Object (readonly)
Returns the value of attribute velocity.
182 183 184 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 182 def velocity @velocity end |
Class Method Details
.from_data(data) ⇒ Object
190 191 192 193 194 195 196 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 190 def self.from_data(data) new( local_position: offset(data, "l", "local_position"), global_position: offset(data, "g", "global_position"), velocity: offset(data, "v", "velocity") ) end |