Class: Ant::Bot::CommandDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/ant/bot/command_definition.rb

Overview

Wraps a collection of commands.

Instance Method Summary collapse

Constructor Details

#initializeCommandDefinition

Returns a new instance of CommandDefinition.



35
36
37
# File 'lib/ant/bot/command_definition.rb', line 35

def initialize
  @commands = {}
end

Instance Method Details

#[](name) ⇒ Object

Returns a command with the name



45
46
47
# File 'lib/ant/bot/command_definition.rb', line 45

def [](name)
  @commands[name]
end

#register_command(name, params, block) ⇒ Object

Stores an operation definition



40
41
42
# File 'lib/ant/bot/command_definition.rb', line 40

def register_command(name, params, block)
  @commands[name] = Command.new(params, block)
end