NAME
Mixin::ExtraFields::Hive - infest your objects with hives
VERSION
version 0.005
$Id: Hive.pm 28691 2007-04-03 00:14:59Z rjbs $
SYNOPSIS
use Mixin::ExtraFields::Hive -hive => {
moniker => 'registry',
driver => 'DBI',
};
DESCRIPTION
This module provides a Data::Hive to other classes' objects as a mix-in, powered by Mixin::ExtraFields. It behaves like Mixin::ExtraFields, but generates a different set of methods. It can use any Mixin::ExtraFields driver.
GENERATED METHODS
hive
The main export of this module is the hive
method, generated by importing the -hive
group. The method will be imported under the moniker given to the hive
group. If this all sounds like Greek, you should probably re-read the Mixin::ExtraFields documentation. As a simple example, however, the code in the "Synopsis", above, would generate a registry
method instead of a hive
method.
This method will return a Data::Hive object for extra fields for the object on which it's called. At present, the Data::Hive object is recreated for each call to the hive
method. In the future, it will be possible to cache these on the object or in some other manner.
other methods
At present, two support methods are installed by this mixin. These methods may go away in the future, when a more purpose-built subclass of Data::Hive::Store is used.
These methods are:
_mutate_hive - acts as a combined get/set extra accessor
_exists_hive - acts as the standard exists_extra method
_empty_hive - deletes all hive data
_delete_hive - deletes a single hive entry
AUTHOR
This code was written by Ricardo SIGNES. His work in 2006 was sponsored by Listbox.
COPYRIGHT AND LICENSE
Copyright (C) 2006, Ricardo SIGNES. This code is free software, and is available under the same terms as perl itself.
TODO
provide a customizable means to cache created Data::Hive objects