Class: Ruflet::Events::ScaleEndEvent
- Inherits:
-
BasePayload
- Object
- BasePayload
- Ruflet::Events::ScaleEndEvent
- Defined in:
- lib/ruflet_ui/ruflet/events/gesture_events.rb
Instance Attribute Summary collapse
-
#pointer_count ⇒ Object
readonly
Returns the value of attribute pointer_count.
-
#velocity ⇒ Object
readonly
Returns the value of attribute velocity.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(pointer_count:, velocity:) ⇒ ScaleEndEvent
constructor
A new instance of ScaleEndEvent.
Methods inherited from BasePayload
duration, offset, pick, stringify_keys
Constructor Details
#initialize(pointer_count:, velocity:) ⇒ ScaleEndEvent
Returns a new instance of ScaleEndEvent.
352 353 354 355 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 352 def initialize(pointer_count:, velocity:) @pointer_count = pointer_count @velocity = velocity end |
Instance Attribute Details
#pointer_count ⇒ Object (readonly)
Returns the value of attribute pointer_count.
350 351 352 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 350 def pointer_count @pointer_count end |
#velocity ⇒ Object (readonly)
Returns the value of attribute velocity.
350 351 352 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 350 def velocity @velocity end |
Class Method Details
.from_data(data) ⇒ Object
357 358 359 360 361 362 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 357 def self.from_data(data) new( pointer_count: pick(data, "pc", "pointer_count"), velocity: offset(data, "v", "velocity") ) end |