Bot::Cobalt::Core::ContextMeta - Base class for context-related metadata
$cmeta->add($context, $key, $ref); $cmeta->del($context, $key); $cmeta->clear($context); $cmeta->list($context);
This is the ContextMeta base class, providing some easy per-context hash management methods to subclasses such as Bot::Cobalt::Core::ContextMeta::Auth and Bot::Cobalt::Core::ContextMeta::Ignore.
Bot::Cobalt::Core uses ContextMeta subclasses to provide auth and ignore attributes.
->add($context, $key, $meta_ref)
Add a new item; subclasses will usually use a custom constructor to provide a custom metadata hashref as the third argument.
->del($context, $key)
Delete a specific item.
->clear() ->clear($context)
Clear a specified context entirely.
With no arguments, clear everything we know about every context.
->fetch($context, $key)
Retrieve the 'meta' hash reference for a specified key.
In list context, returns the list of keys:
my @contexts = $cmeta->list; my @ckeys = $cmeta->list($context);
In scalar context, returns the actual hash reference (if it exists).
Less-ambiguous alternative to "list" -- always get a hash reference.
Less-ambiguous alternative to "list" -- always get a list of keys.
Jon Portnoy <avenj@cobaltirc.org>
http://www.cobaltirc.org
To install Bot::Cobalt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bot::Cobalt
CPAN shell
perl -MCPAN -e shell install Bot::Cobalt
For more information on module installation, please visit the detailed CPAN module installation guide.