Class: Ruflet::Events::TapEvent
- Inherits:
-
BasePayload
- Object
- BasePayload
- Ruflet::Events::TapEvent
- 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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(kind:, local_position:, global_position:) ⇒ TapEvent
constructor
A new instance of TapEvent.
Methods inherited from BasePayload
duration, offset, pick, stringify_keys
Constructor Details
#initialize(kind:, local_position:, global_position:) ⇒ TapEvent
Returns a new instance of TapEvent.
80 81 82 83 84 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 80 def initialize(kind:, local_position:, global_position:) @kind = kind @local_position = local_position @global_position = global_position end |
Instance Attribute Details
#global_position ⇒ Object (readonly)
Returns the value of attribute global_position.
78 79 80 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 78 def global_position @global_position end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
78 79 80 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 78 def kind @kind end |
#local_position ⇒ Object (readonly)
Returns the value of attribute local_position.
78 79 80 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 78 def local_position @local_position end |
Class Method Details
.from_data(data) ⇒ Object
86 87 88 89 90 91 92 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 86 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") ) end |