Class: Ruflet::Events::DragTargetEvent
- Inherits:
-
GenericEvent
- Object
- BasePayload
- GenericEvent
- Ruflet::Events::DragTargetEvent
- Defined in:
- lib/ruflet_ui/ruflet/events/gesture_events.rb
Instance Attribute Summary collapse
-
#accept ⇒ Object
readonly
Returns the value of attribute accept.
-
#src_id ⇒ Object
readonly
Returns the value of attribute src_id.
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
Attributes inherited from GenericEvent
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(raw:, src_id:, accept: nil, x: nil, y: nil) ⇒ DragTargetEvent
constructor
A new instance of DragTargetEvent.
Methods inherited from BasePayload
duration, offset, offset_pair, pick, stringify_keys
Constructor Details
#initialize(raw:, src_id:, accept: nil, x: nil, y: nil) ⇒ DragTargetEvent
Returns a new instance of DragTargetEvent.
142 143 144 145 146 147 148 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 142 def initialize(raw:, src_id:, accept: nil, x: nil, y: nil) super(raw: raw, value: src_id) @src_id = src_id @accept = accept @x = x @y = y end |
Instance Attribute Details
#accept ⇒ Object (readonly)
Returns the value of attribute accept.
140 141 142 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 140 def accept @accept end |
#src_id ⇒ Object (readonly)
Returns the value of attribute src_id.
140 141 142 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 140 def src_id @src_id end |
#x ⇒ Object (readonly)
Returns the value of attribute x.
140 141 142 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 140 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
140 141 142 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 140 def y @y end |
Class Method Details
.from_data(data) ⇒ Object
150 151 152 153 154 155 156 157 158 159 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 150 def self.from_data(data) raw = data.is_a?(Hash) ? stringify_keys(data) : {} new( raw: raw, src_id: raw["src_id"] || raw["src"] || raw["value"] || raw["v"], accept: raw["accept"] || raw["a"], x: raw["x"], y: raw["y"] ) end |