Class: TouchscreenTaps::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/touchscreen_taps/event.rb

Overview

Parsed Event object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, finger, move_x = nil, move_y = nil) ⇒ Event

Returns a new instance of Event.



12
13
14
15
16
17
18
# File 'lib/touchscreen_taps/event.rb', line 12

def initialize(type, finger, move_x = nil, move_y = nil)
  @type = type
  @finger = finger
  @move_x = move_x
  @move_y = move_y
  @timestamp = Process.clock_gettime(Process::CLOCK_MONOTONIC)
end

Instance Attribute Details

#fingerObject (readonly)

Returns the value of attribute finger.



8
9
10
# File 'lib/touchscreen_taps/event.rb', line 8

def finger
  @finger
end

#move_xObject (readonly)

Returns the value of attribute move_x.



9
10
11
# File 'lib/touchscreen_taps/event.rb', line 9

def move_x
  @move_x
end

#move_yObject (readonly)

Returns the value of attribute move_y.



10
11
12
# File 'lib/touchscreen_taps/event.rb', line 10

def move_y
  @move_y
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



6
7
8
# File 'lib/touchscreen_taps/event.rb', line 6

def timestamp
  @timestamp
end

#typeObject (readonly)

Returns the value of attribute type.



7
8
9
# File 'lib/touchscreen_taps/event.rb', line 7

def type
  @type
end