Class: Ruflet::Events::LongPressStartEvent
- Inherits:
-
BasePayload
- Object
- BasePayload
- Ruflet::Events::LongPressStartEvent
- 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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(local_position:, global_position:) ⇒ LongPressStartEvent
constructor
A new instance of LongPressStartEvent.
Methods inherited from BasePayload
duration, offset, pick, stringify_keys
Constructor Details
#initialize(local_position:, global_position:) ⇒ LongPressStartEvent
Returns a new instance of LongPressStartEvent.
148 149 150 151 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 148 def initialize(local_position:, global_position:) @local_position = local_position @global_position = global_position end |
Instance Attribute Details
#global_position ⇒ Object (readonly)
Returns the value of attribute global_position.
146 147 148 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 146 def global_position @global_position end |
#local_position ⇒ Object (readonly)
Returns the value of attribute local_position.
146 147 148 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 146 def local_position @local_position end |
Class Method Details
.from_data(data) ⇒ Object
153 154 155 156 157 158 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 153 def self.from_data(data) new( local_position: offset(data, "l", "local_position"), global_position: offset(data, "g", "global_position") ) end |