Class: IrPtz::IrCommandRecorder::Command

Inherits:
Struct
  • Object
show all
Defined in:
lib/ir_ptz/ir_command_recorder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#action_codeObject

Returns the value of attribute action_code

Returns:

  • (Object)

    the current value of action_code



5
6
7
# File 'lib/ir_ptz/ir_command_recorder.rb', line 5

def action_code
  @action_code
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



5
6
7
# File 'lib/ir_ptz/ir_command_recorder.rb', line 5

def key
  @key
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



5
6
7
# File 'lib/ir_ptz/ir_command_recorder.rb', line 5

def title
  @title
end

Instance Method Details

#saveObject



6
7
8
9
10
11
# File 'lib/ir_ptz/ir_command_recorder.rb', line 6

def save
  ArduinoIrRemote::DATA['action_mappings'][key] = title
  ArduinoIrRemote::DATA['actions'][title] = action_code
  ArduinoIrRemote::DATA.save
  puts "#{title} saved!"
end