Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Mail::Action::Storage
manages storage for Mail::Action and descendants

Mail::Action::Storage - manages storage for Mail::Action and descendants


NAME

Mail::Action::Storage - manages storage for Mail::Action and descendants


SYNOPSIS


        use base 'Mail::Action::Storage';


DESCRIPTION

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 the Mail::SimpleList::Aliases manpage or the Mail::TempAddress::Addresses manpage for more ideas.


METHODS

  • new( [ $storage_dir ] )
  • Creates a new Mail::Action::Storage object. The single argument is required; without it, this will throw an exception. $storage_dir should be a directory where to store data files. Beware that in filter mode, relative paths can be terribly ambiguous.

  • stored_class()
  • Returns the name of the class for which this class stores data. For example, the Mail::TempAddress::Addresses manpage returns Mail::TempAddress::Address here.

    You must override this, as this returns a blank string. It may throw an exception in the future, just to make sure.

  • storage_dir()
  • Returns the storage directory set in the constructor.

  • storage_extension()
  • 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.

  • create()
  • 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 $object with the name given in $name.

  • fetch( $name )
  • Creates and returns a stored object represented by the given name. This will return nothing if the object does not exist.


AUTHOR

chromatic, chromatic@wgz.org, with helpful suggestions from friends, family, and peers.


BUGS

None known.


TODO

No plans. It's pretty nice as it is.


SEE ALSO

the Mail::SimpleList::Addresses manpage, the Mail::TempAddress::Addresses manpage, and James FitzGibbon's the Mail::TempAddress::Addresses::Purgeable manpage for examples of subclassing and extending this class.


COPYRIGHT

Copyright (c) 2003, chromatic. All rights reserved. This module is distributed under the same terms as Perl itself. Convenient for you!

Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy