Method: Textbringer::Commands.define_command

Defined in:
lib/textbringer/commands.rb

.define_command(name, doc: "No documentation", &block) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/textbringer/commands.rb', line 26

def define_command(name, doc: "No documentation", &block)
  name = name.intern
  Commands.send(:define_method, name, &block)
  Commands.send(:module_function, name)
  Commands.command_table[name] = Command.new(name, block, doc)
  name
end