Class: Ruflet::Events::TapMoveEvent
- Inherits:
-
BasePayload
- Object
- BasePayload
- Ruflet::Events::TapMoveEvent
- Defined in:
- lib/ruflet_ui/ruflet/events/gesture_events.rb
Instance Attribute Summary collapse
-
#delta ⇒ Object
readonly
Returns the value of attribute delta.
-
#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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(kind:, local_position:, global_position:, delta:) ⇒ TapMoveEvent
constructor
A new instance of TapMoveEvent.
Methods inherited from BasePayload
duration, offset, pick, stringify_keys
Constructor Details
#initialize(kind:, local_position:, global_position:, delta:) ⇒ TapMoveEvent
Returns a new instance of TapMoveEvent.
98 99 100 101 102 103 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 98 def initialize(kind:, local_position:, global_position:, delta:) @kind = kind @local_position = local_position @global_position = global_position @delta = delta end |
Instance Attribute Details
#delta ⇒ Object (readonly)
Returns the value of attribute delta.
96 97 98 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 96 def delta @delta end |
#global_position ⇒ Object (readonly)
Returns the value of attribute global_position.
96 97 98 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 96 def global_position @global_position end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
96 97 98 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 96 def kind @kind end |
#local_position ⇒ Object (readonly)
Returns the value of attribute local_position.
96 97 98 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 96 def local_position @local_position end |
Class Method Details
.from_data(data) ⇒ Object
105 106 107 108 109 110 111 112 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 105 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"), delta: offset(data, "d", "delta") ) end |