NAME

Mixin::ExtraFields::Hive - infest your objects with hives

VERSION

version 0.006

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

TODO

  • provide a customizable means to cache created Data::Hive objects

AUTHOR

Ricardo Signes <rjbs@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2007 by Ricardo Signes <rjbs@cpan.org>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.