Class: Ruflet::Events::DragDownEvent

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(local_position:, global_position:) ⇒ DragDownEvent

Returns a new instance of DragDownEvent.



202
203
204
205
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 202

def initialize(local_position:, global_position:)
  @local_position = local_position
  @global_position = global_position
end

Instance Attribute Details

#global_positionObject (readonly)

Returns the value of attribute global_position.



200
201
202
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 200

def global_position
  @global_position
end

#local_positionObject (readonly)

Returns the value of attribute local_position.



200
201
202
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 200

def local_position
  @local_position
end

Class Method Details

.from_data(data) ⇒ Object



207
208
209
210
211
212
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 207

def self.from_data(data)
  new(
    local_position: offset(data, "l", "local_position"),
    global_position: offset(data, "g", "global_position")
  )
end