Mail::Action::Storage - manages storage for Mail::Action and descendants
use base 'Mail::Action::Storage';
Mail::Action::Storage is a parent class for Mail::Action users that need to store data between invocations. You must subclass this module for your own needs. See Mail::SimpleList::Aliases or Mail::TempAddress::Addresses for more ideas.
new( [ $storage_dir ] )
Creates a new Mail::Action::Storage object. The single argument is required; without it, this will throw an exception.
$storage_dirshould be a directory where to store data files. Beware that in filter mode, relative paths can be terribly ambiguous.
Returns the name of the class for which this class stores data. For example, Mail::TempAddress::Addresses returns
You must override this, as this returns a blank string. It may throw an exception in the future, just to make sure.
Returns the storage directory set in the constructor.
Returns the extension of the generated address files. By default, this is
mas. Note that the leading period is not part of the extension. You'll want to override this.
storage_file( $name )
Given the name of a file (but not a filename), returns the path and full name of the file as it will be saved on disk. This is an internal method and you probably don't need to override it unless you're doing something quite wacky.
Creates a new object of the class you're storing. This is an empty method. You must override this in your subclass.
exists( $name )
Returns whether a stored object of the given name exists.
save( $object, $name )
Saves a stored object provided as
$objectwith the name given in
fetch( $name )
Creates and returns a stored object represented by the given name. This will return nothing if the object does not exist.
firstname.lastname@example.org, with helpful suggestions from friends, family, and peers.
No plans. It's pretty nice as it is.
Copyright (c) 2003 - 2009 chromatic. Some rights reserved. You may use, modify, and distribute this module under the same terms as Perl 5.10 itself.