Module: Commands

Defined in:
lib/city_watch/commands.rb

Class Method Summary collapse

Class Method Details

.dataObject



11
12
13
14
15
# File 'lib/city_watch/commands.rb', line 11

def self.data
  @command_list.inject({}) do |acc,cmd|
    acc[cmd.name] = cmd.data
  end
end

.register(cls) ⇒ Object



17
18
19
20
# File 'lib/city_watch/commands.rb', line 17

def self.register(cls)
  @command_list ||= []
  @command_list << cls
end

.testObject



3
4
5
6
7
8
9
# File 'lib/city_watch/commands.rb', line 3

def self.test
  @command_list.each do |cmd|
    puts "Running #{cmd.name}:"
    puts cmd.data.inspect
    puts "Done."
  end
end