Class: Ruflet::Events::DragUpdateEvent
- Inherits:
-
BasePayload
- Object
- BasePayload
- Ruflet::Events::DragUpdateEvent
- Defined in:
- lib/ruflet_ui/ruflet/events/gesture_events.rb
Instance Attribute Summary collapse
-
#global_delta ⇒ Object
readonly
Returns the value of attribute global_delta.
-
#global_position ⇒ Object
readonly
Returns the value of attribute global_position.
-
#local_delta ⇒ Object
readonly
Returns the value of attribute local_delta.
-
#local_position ⇒ Object
readonly
Returns the value of attribute local_position.
-
#primary_delta ⇒ Object
readonly
Returns the value of attribute primary_delta.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(local_position:, global_position:, local_delta:, global_delta:, primary_delta:, timestamp:) ⇒ DragUpdateEvent
constructor
A new instance of DragUpdateEvent.
Methods inherited from BasePayload
duration, offset, pick, stringify_keys
Constructor Details
#initialize(local_position:, global_position:, local_delta:, global_delta:, primary_delta:, timestamp:) ⇒ DragUpdateEvent
Returns a new instance of DragUpdateEvent.
238 239 240 241 242 243 244 245 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 238 def initialize(local_position:, global_position:, local_delta:, global_delta:, primary_delta:, timestamp:) @local_position = local_position @global_position = global_position @local_delta = local_delta @global_delta = global_delta @primary_delta = primary_delta @timestamp = end |
Instance Attribute Details
#global_delta ⇒ Object (readonly)
Returns the value of attribute global_delta.
236 237 238 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 236 def global_delta @global_delta end |
#global_position ⇒ Object (readonly)
Returns the value of attribute global_position.
236 237 238 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 236 def global_position @global_position end |
#local_delta ⇒ Object (readonly)
Returns the value of attribute local_delta.
236 237 238 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 236 def local_delta @local_delta end |
#local_position ⇒ Object (readonly)
Returns the value of attribute local_position.
236 237 238 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 236 def local_position @local_position end |
#primary_delta ⇒ Object (readonly)
Returns the value of attribute primary_delta.
236 237 238 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 236 def primary_delta @primary_delta end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
236 237 238 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 236 def @timestamp end |
Class Method Details
.from_data(data) ⇒ Object
247 248 249 250 251 252 253 254 255 256 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 247 def self.from_data(data) new( local_position: offset(data, "l", "local_position"), global_position: offset(data, "g", "global_position"), local_delta: offset(data, "ld", "local_delta"), global_delta: offset(data, "gd", "global_delta"), primary_delta: pick(data, "pd", "primary_delta"), timestamp: duration(data, "ts", "timestamp") ) end |