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.



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

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.



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

def pointer_count
  @pointer_count
end

#velocityObject (readonly)

Returns the value of attribute velocity.



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

def velocity
  @velocity
end

Class Method Details

.from_data(data) ⇒ Object



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

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