Class: Ruflet::Events::DragStartEvent
- Inherits:
-
BasePayload
- Object
- BasePayload
- Ruflet::Events::DragStartEvent
- Defined in:
- lib/ruflet_ui/ruflet/events/gesture_events.rb
Instance Attribute Summary collapse
-
#global_position ⇒ Object
readonly
Returns the value of attribute global_position.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#local_position ⇒ Object
readonly
Returns the value of attribute local_position.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(kind:, local_position:, global_position:, timestamp:) ⇒ DragStartEvent
constructor
A new instance of DragStartEvent.
Methods inherited from BasePayload
duration, offset, offset_pair, pick, stringify_keys
Constructor Details
#initialize(kind:, local_position:, global_position:, timestamp:) ⇒ DragStartEvent
Returns a new instance of DragStartEvent.
317 318 319 320 321 322 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 317 def initialize(kind:, local_position:, global_position:, timestamp:) @kind = kind @local_position = local_position @global_position = global_position @timestamp = end |
Instance Attribute Details
#global_position ⇒ Object (readonly)
Returns the value of attribute global_position.
315 316 317 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 315 def global_position @global_position end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
315 316 317 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 315 def kind @kind end |
#local_position ⇒ Object (readonly)
Returns the value of attribute local_position.
315 316 317 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 315 def local_position @local_position end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
315 316 317 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 315 def @timestamp end |
Class Method Details
.from_data(data) ⇒ Object
324 325 326 327 328 329 330 331 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 324 def self.from_data(data) new( kind: pick(data, "k", "kind"), local_position: offset(data, "l", "local_position"), global_position: offset(data, "g", "global_position"), timestamp: duration(data, "ts", "timestamp") ) end |