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, 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_countObject (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

#velocityObject (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