=head1 NAME
-MooseX::AttributeHelpers
+MooseX::AttributeHelpers - Extend your attribute interfaces
=head1 SYNOPSIS
+ package MyClass;
+ use Moose;
+
+ has mapping => (
+ metaclass => 'Collection::Hash',
+ is => 'rw',
+ isa => 'HashRef',
+ default => sub { {} },
+ provides => {
+ exists => 'exists_in_mapping',
+ keys => 'ids_in_mapping',
+ get => 'get_mapping',
+ set => 'set_mapping',
+ },
+ );
+
+ # ...
+
+ my $obj = MyClass->new;
+ $obj->set_mapping(4, 'foo');
+ $obj->set_mapping(5, 'bar');
+ $obj->set_mapping(6, 'baz');
+
+ # prints 'bar'
+ print $obj->get_mapping(5) if $obj->exists_in_mapping(5);
+
+ # prints '4, 5, 6'
+ print join ', ', $obj->ids_in_mapping;
+
=head1 DESCRIPTION
+While L<Moose> attributes provide you with a way to name your accessors,
+readers, writers, clearers and predicates, this library provides commonly
+used attribute helper methods for more specific types of data.
+
+As seen in the L</SYNOPSIS>, you specify the extension via the
+C<metaclass> parameter. Available meta classes are:
+
+=over
+
+=item L<Number|MooseX::AttributeHelpers::Number>
+
+Common numerical operations.
+
+=item L<Counter|MooseX::AttributeHelpers::Counter>
+
+Methods for incrementing and decrementing a counter attribute.
+
+=item L<Collection::Hash|MooseX::AttributeHelpers::Collection::Hash>
+
+Common methods for hash references.
+
+=item L<Collection::Array|MooseX::AttributeHelpers::Collection::Array>
+
+Common methods for array references.
+
+=back
+
=head1 BUGS
All complex software has bugs lurking in it, and this module is no
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.
-=cut
\ No newline at end of file
+=cut
$_ => $method_provider->get_method($_)
} $method_provider->get_method_list
};
- }
+ },
);
# extend the parents stuff to make sure
=head1 DESCRIPTION
+Base class for attribute helpers.
+
+=head1 ATTRIBUTES
+
+=head2 provides
+
+=head2 method_provider
+
+=head2 method_constructors
+
+=head1 EXTENDED ATTRIBUTES
+
+=head2 $!default
+
+C<$!default> is now required.
+
+=head2 type_constraint
+
+C<type_constraint> is now required.
+
=head1 METHODS
+=head2 helper_type
+
=head1 BUGS
All complex software has bugs lurking in it, and this module is no