Bot::BasicBot::Pluggable::Store::Memory3pm
Use memory (ram) to provide a storage backend
Usage
my $store = Bot::BasicBot::Pluggable::Store::Memory->new();$store->set( "namespace", "key", "value" );
Version
version 1.30
Overview
This is a Bot::BasicBot::Pluggable::Store that uses memory (RAM) to store the values set by modules. To spell the obvious out, this means that your data won't persist between invocations of your bot. So this is mainly for testing and storing data for a short time.
This module is just a bare bone subclass of Bot::BasicBot::Pluggable::Store and does not implement any methods of its own. In a perfect world Bot::BasicBot::Pluggable::Store would just be a abstract base class, but it was implemented as normale in-memory storage class. Due to Bot::BasicBot::Pluggable object creation you can either specify a already created storage object or a string that is simply appended to "Bot::BasicBot::Pluggable::Store::". So if you just want to use memory storage you have to load it this way:
my $bot => Bot::BasicBot::Pluggable->new ( store => Bot::BasicBot::Pluggable::Store->new() );
Now you can use load it as any other storage module:
my $bot => Bot::BasicBot::Pluggable->new ( store => 'Memory' );
In this way we don't break any existing code.
Releases
6 releases since Debian 8 (Jessie); the text changed 4 times.