Class: Ruflet::Events::ScaleEndEvent

Inherits:
BasePayload show all
Defined in:
lib/ruflet_ui/ruflet/events/gesture_events.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BasePayload

duration, offset, offset_pair, pick, stringify_keys

Constructor Details

#initialize(pointer_count:, velocity:) ⇒ ScaleEndEvent

Returns a new instance of ScaleEndEvent.



452
453
454
455
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 452

def initialize(pointer_count:, velocity:)
  @pointer_count = pointer_count
  @velocity = velocity
end

Instance Attribute Details

#pointer_countObject (readonly)

Returns the value of attribute pointer_count.



450
451
452
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 450

def pointer_count
  @pointer_count
end

#velocityObject (readonly)

Returns the value of attribute velocity.



450
451
452
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 450

def velocity
  @velocity
end

Class Method Details

.from_data(data) ⇒ Object



457
458
459
460
461
462
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 457

def self.from_data(data)
  new(
    pointer_count: pick(data, "pc", "pointer_count"),
    velocity: offset(data, "v", "velocity")
  )
end