Module: Meta

Defined in:
lib/meta.rb

Class Method Summary collapse

Class Method Details

.command_from_name(commandname, tracker) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/meta.rb', line 4

def Meta.command_from_name(commandname, tracker)
	begin
		klass = Commands.const_get(commandname.capitalize + 'Command')
		klass.new tracker
	rescue NameError
		nil
	end
end

.list_of_commandsObject



13
14
15
# File 'lib/meta.rb', line 13

def Meta.list_of_commands()
	Commands.constants.select{|x| x =~ /Command$/ }.map{|c| c.to_s.gsub /Command$/, '' }
end