Module: CamperVan::CommandDefinition::ClassMethods

Defined in:
lib/camper_van/command_definition.rb

Instance Method Summary collapse

Instance Method Details

#handle(command, &block) ⇒ Object

Public: defines a handler for the given irc command

command - the irc command to define a handler for

Example:

handle :nick do |args|
  # ... change nickname to ...
end

“‘ def handle_nick(*args)

# contents of block

end “‘



34
35
36
# File 'lib/camper_van/command_definition.rb', line 34

def handle(command, &block)
  define_method "handle_#{command}".to_sym, &block
end