Class | Irc::Bot::Registry::Accessor |
In: |
lib/rbot/registry.rb
|
Parent: | Object |
If you don‘t need to store objects, and strictly want a persistant hash of strings, you can override the store/restore methods to suit your needs, for example (in your plugin):
def initialize class << @registry def store(val) val end def restore(val) val end end end
Your plugins section of the registry is private, it has its own namespace (derived from the plugin‘s class name, so change it and lose your data). Calls to registry.each etc, will only iterate over your namespace.
recovery | [RW] |
plugins don‘t call this - a Registry::Accessor is created for them and is accessible via @registry.