module LIRC::Commands

Constants

DrvOption
List
SendOnce
SendStart
SendStop
SetInputlog
SetTransmitters
Simulate
Version

Public Class Methods

all_commands() click to toggle source
# File lib/lirc/commands.rb, line 5
def self.all_commands
  constants.keep_if do |x|
    const_get(x).instance_of?(Class)
  end.map(&public_method(:serialize_command_name))
end
serialize_command_name(klass) click to toggle source
# File lib/lirc/commands.rb, line 11
def self.serialize_command_name(klass)
  klass = klass.to_s.split(":").fetch(-1)
  rest = klass[1..-1].gsub(/[A-Z]/) do |chr|
    "_#{chr}"
  end
  "#{klass[0]}#{rest.upcase}"
end