Module: Irc::Bot::Plugins::RemoteBotModule
- Included in:
- RemoteCoreBotModule, RemotePlugin
- Defined in:
- lib/rbot/core/remote.rb
Overview
We create a new Ruby module that can be included by BotModules that want to provide remote interfaces
Instance Method Summary collapse
-
#cleanup ⇒ Object
Redefine the default cleanup method.
-
#remote_cleanup ⇒ Object
Unregister the remote maps.
-
#remote_map(*args) ⇒ Object
The remote_map acts just like the BotModule#map method, except that the map is registered to the @bot’s remote_dispatcher.
Instance Method Details
#cleanup ⇒ Object
Redefine the default cleanup method.
288 289 290 291 |
# File 'lib/rbot/core/remote.rb', line 288 def cleanup super remote_cleanup end |
#remote_cleanup ⇒ Object
Unregister the remote maps.
278 279 280 281 282 283 284 |
# File 'lib/rbot/core/remote.rb', line 278 def remote_cleanup return unless defined? @remote_maps @remote_maps.each { |h| @bot.remote_dispatcher.unmap(self, h) } @remote_maps.clear end |
#remote_map(*args) ⇒ Object
The remote_map acts just like the BotModule#map method, except that the map is registered to the @bot’s remote_dispatcher. Also, the remote map handle is handled for the cleanup management
271 272 273 274 |
# File 'lib/rbot/core/remote.rb', line 271 def remote_map(*args) @remote_maps = Array.new unless defined? @remote_maps @remote_maps << @bot.remote_dispatcher.map(self, *args) end |