Class: Ruflet::Events::DragEndEvent
- Inherits:
-
BasePayload
- Object
- BasePayload
- Ruflet::Events::DragEndEvent
- 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.
-
#local_position ⇒ Object
readonly
Returns the value of attribute local_position.
-
#primary_velocity ⇒ Object
readonly
Returns the value of attribute primary_velocity.
-
#velocity ⇒ Object
readonly
Returns the value of attribute velocity.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(local_position:, global_position:, velocity:, primary_velocity:) ⇒ DragEndEvent
constructor
A new instance of DragEndEvent.
Methods inherited from BasePayload
duration, offset, pick, stringify_keys
Constructor Details
#initialize(local_position:, global_position:, velocity:, primary_velocity:) ⇒ DragEndEvent
Returns a new instance of DragEndEvent.
262 263 264 265 266 267 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 262 def initialize(local_position:, global_position:, velocity:, primary_velocity:) @local_position = local_position @global_position = global_position @velocity = velocity @primary_velocity = primary_velocity end |
Instance Attribute Details
#global_position ⇒ Object (readonly)
Returns the value of attribute global_position.
260 261 262 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 260 def global_position @global_position end |
#local_position ⇒ Object (readonly)
Returns the value of attribute local_position.
260 261 262 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 260 def local_position @local_position end |
#primary_velocity ⇒ Object (readonly)
Returns the value of attribute primary_velocity.
260 261 262 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 260 def primary_velocity @primary_velocity end |
#velocity ⇒ Object (readonly)
Returns the value of attribute velocity.
260 261 262 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 260 def velocity @velocity end |
Class Method Details
.from_data(data) ⇒ Object
269 270 271 272 273 274 275 276 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 269 def self.from_data(data) new( local_position: offset(data, "l", "local_position"), global_position: offset(data, "g", "global_position"), velocity: offset(data, "v", "velocity"), primary_velocity: pick(data, "pv", "primary_velocity") ) end |