Class: Fusuma::EventTrigger

Inherits:
Object
  • Object
show all
Defined in:
lib/fusuma/event_trigger.rb

Overview

manage actions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(finger, direction, action_type) ⇒ EventTrigger

Returns a new instance of EventTrigger.



4
5
6
7
8
# File 'lib/fusuma/event_trigger.rb', line 4

def initialize(finger, direction, action_type)
  @finger      = finger.to_i
  @direction   = direction
  @action_type = action_type
end

Instance Attribute Details

#action_typeObject (readonly)

Returns the value of attribute action_type.



9
10
11
# File 'lib/fusuma/event_trigger.rb', line 9

def action_type
  @action_type
end

#directionObject (readonly)

Returns the value of attribute direction.



9
10
11
# File 'lib/fusuma/event_trigger.rb', line 9

def direction
  @direction
end

#fingerObject (readonly)

Returns the value of attribute finger.



9
10
11
# File 'lib/fusuma/event_trigger.rb', line 9

def finger
  @finger
end

Instance Method Details

#send_commandObject



11
12
13
14
# File 'lib/fusuma/event_trigger.rb', line 11

def send_command
  MultiLogger.info("trigger event: #{command}")
  exec_command(command)
end