Class | ::Bot::RemoteDispatcher
In: | lib/rbot/core/remote.rb
Parent: | MessageMapper

The RemoteDispatcher is a kind of MessageMapper, tuned to handle RemoteMessages

### Methods

handle map new unmap

### Public Class methods

new(bot)

It is initialized by passing it the bot instance

### Public Instance methods

handle(m)

We redefine the handle() method from MessageMapper, taking into account that @parent is a bot, and that we don‘t handle fallbacks.

On failure to dispatch anything, the method returns false. If dispatching is successfull, the method returns a Hash.

Presently, the hash returned on success has only one key, :return, whose value is the actual return value of the successfull dispatch.

TODO this same kind of mechanism could actually be used in MessageMapper itself to be able to handle the case of multiple plugins having the same ‘first word’ …

map(botmodule, *args)

The map method for the RemoteDispatcher returns the index of the inserted template

unmap(botmodule, handle)

The unmap method for the RemoteDispatcher nils the template at the given index, therefore effectively removing the mapping

[Validate]