class Irc::Bot::MessageMapper

MessageMapper is a class designed to reduce the amount of regexps and string parsing plugins and bot modules need to do, in order to process and respond to messages.

You add templates to the MessageMapper which are examined by the handle method when handling a message. The templates tell the mapper which method in its parent class (your class) to invoke for that message. The string is split, optionally defaulted and validated before being passed to the matched method.

A template such as “foo :option :otheroption” will match the string “foo bar baz” and, by default, result in method foo being called, if present, in the parent class. It will receive two parameters, the message (derived from BasicUserMessage) and a Hash containing

{:option => "bar", :otheroption => "baz"}

See the map method for more details.