Class: Ruflet::Events::PointerEvent
- Inherits:
-
BasePayload
- Object
- BasePayload
- Ruflet::Events::PointerEvent
- Defined in:
- lib/ruflet_ui/ruflet/events/gesture_events.rb
Instance Attribute Summary collapse
-
#device ⇒ Object
readonly
Returns the value of attribute device.
-
#distance ⇒ Object
readonly
Returns the value of attribute distance.
-
#distance_max ⇒ Object
readonly
Returns the value of attribute distance_max.
-
#global_delta ⇒ Object
readonly
Returns the value of attribute global_delta.
-
#global_position ⇒ Object
readonly
Returns the value of attribute global_position.
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
-
#local_delta ⇒ Object
readonly
Returns the value of attribute local_delta.
-
#local_position ⇒ Object
readonly
Returns the value of attribute local_position.
-
#orientation ⇒ Object
readonly
Returns the value of attribute orientation.
-
#pressure ⇒ Object
readonly
Returns the value of attribute pressure.
-
#pressure_max ⇒ Object
readonly
Returns the value of attribute pressure_max.
-
#pressure_min ⇒ Object
readonly
Returns the value of attribute pressure_min.
-
#radius_major ⇒ Object
readonly
Returns the value of attribute radius_major.
-
#radius_max ⇒ Object
readonly
Returns the value of attribute radius_max.
-
#radius_min ⇒ Object
readonly
Returns the value of attribute radius_min.
-
#radius_minor ⇒ Object
readonly
Returns the value of attribute radius_minor.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#tilt ⇒ Object
readonly
Returns the value of attribute tilt.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(kind:, local_position:, global_position:, timestamp:, device:, pressure:, pressure_min:, pressure_max:, distance:, distance_max:, size:, radius_major:, radius_minor:, radius_min:, radius_max:, orientation:, tilt:, local_delta:, global_delta:) ⇒ PointerEvent
constructor
A new instance of PointerEvent.
Methods inherited from BasePayload
duration, offset, pick, stringify_keys
Constructor Details
#initialize(kind:, local_position:, global_position:, timestamp:, device:, pressure:, pressure_min:, pressure_max:, distance:, distance_max:, size:, radius_major:, radius_minor:, radius_min:, radius_max:, orientation:, tilt:, local_delta:, global_delta:) ⇒ PointerEvent
Returns a new instance of PointerEvent.
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 372 def initialize(kind:, local_position:, global_position:, timestamp:, device:, pressure:, pressure_min:, pressure_max:, distance:, distance_max:, size:, radius_major:, radius_minor:, radius_min:, radius_max:, orientation:, tilt:, local_delta:, global_delta:) @kind = kind @local_position = local_position @global_position = global_position @timestamp = @device = device @pressure = pressure @pressure_min = pressure_min @pressure_max = pressure_max @distance = distance @distance_max = distance_max @size = size @radius_major = radius_major @radius_minor = radius_minor @radius_min = radius_min @radius_max = radius_max @orientation = orientation @tilt = tilt @local_delta = local_delta @global_delta = global_delta end |
Instance Attribute Details
#device ⇒ Object (readonly)
Returns the value of attribute device.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def device @device end |
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def distance @distance end |
#distance_max ⇒ Object (readonly)
Returns the value of attribute distance_max.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def distance_max @distance_max end |
#global_delta ⇒ Object (readonly)
Returns the value of attribute global_delta.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def global_delta @global_delta end |
#global_position ⇒ Object (readonly)
Returns the value of attribute global_position.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def global_position @global_position end |
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def kind @kind end |
#local_delta ⇒ Object (readonly)
Returns the value of attribute local_delta.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def local_delta @local_delta end |
#local_position ⇒ Object (readonly)
Returns the value of attribute local_position.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def local_position @local_position end |
#orientation ⇒ Object (readonly)
Returns the value of attribute orientation.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def orientation @orientation end |
#pressure ⇒ Object (readonly)
Returns the value of attribute pressure.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def pressure @pressure end |
#pressure_max ⇒ Object (readonly)
Returns the value of attribute pressure_max.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def pressure_max @pressure_max end |
#pressure_min ⇒ Object (readonly)
Returns the value of attribute pressure_min.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def pressure_min @pressure_min end |
#radius_major ⇒ Object (readonly)
Returns the value of attribute radius_major.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def radius_major @radius_major end |
#radius_max ⇒ Object (readonly)
Returns the value of attribute radius_max.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def radius_max @radius_max end |
#radius_min ⇒ Object (readonly)
Returns the value of attribute radius_min.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def radius_min @radius_min end |
#radius_minor ⇒ Object (readonly)
Returns the value of attribute radius_minor.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def radius_minor @radius_minor end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def size @size end |
#tilt ⇒ Object (readonly)
Returns the value of attribute tilt.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def tilt @tilt end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
366 367 368 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 366 def @timestamp end |
Class Method Details
.from_data(data) ⇒ Object
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/ruflet_ui/ruflet/events/gesture_events.rb', line 394 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"), timestamp: duration(data, "ts", "timestamp"), device: pick(data, "dev", "device"), pressure: pick(data, "ps", "pressure"), pressure_min: pick(data, "pMin", "pressure_min"), pressure_max: pick(data, "pMax", "pressure_max"), distance: pick(data, "dist", "distance"), distance_max: pick(data, "distMax", "distance_max"), size: pick(data, "size", "size"), radius_major: pick(data, "rMj", "radius_major"), radius_minor: pick(data, "rMn", "radius_minor"), radius_min: pick(data, "rMin", "radius_min"), radius_max: pick(data, "rMax", "radius_max"), orientation: pick(data, "or", "orientation"), tilt: pick(data, "tilt", "tilt"), local_delta: offset(data, "ld", "local_delta"), global_delta: offset(data, "gd", "global_delta") ) end |