eddb3e4c14609957e5dae65b70c9fca72a50e523
[gitmo/MooseX-AttributeHelpers.git] / lib / MooseX / AttributeHelpers / Collection / Hash.pm
1
2 package MooseX::AttributeHelpers::Collection::Hash;
3 use Moose;
4
5 our $VERSION   = '0.02';
6 our $AUTHORITY = 'cpan:STEVAN';
7
8 use MooseX::AttributeHelpers::MethodProvider::Hash;
9
10 extends 'MooseX::AttributeHelpers::Collection';
11
12 has '+method_provider' => (
13     default => 'MooseX::AttributeHelpers::MethodProvider::Hash'
14 );
15
16 sub helper_type { 'HashRef' }
17
18 no Moose;
19
20 # register the alias ...
21 package # hide me from search.cpan.org
22     Moose::Meta::Attribute::Custom::Collection::Hash;
23 sub register_implementation { 'MooseX::AttributeHelpers::Collection::Hash' }
24
25
26 1;
27
28 __END__
29
30 =pod
31
32 =head1 NAME
33
34 MooseX::AttributeHelpers::Collection::Hash
35
36 =head1 SYNOPSIS
37
38   package Stuff;
39   use Moose;
40   use MooseX::AttributeHelpers;
41   
42   has 'options' => (
43       metaclass => 'Collection::Hash',
44       is        => 'ro',
45       isa       => 'HashRef[Str]',
46       default   => sub { {} },
47       provides  => {
48           'set'    => 'set_option',
49           'get'    => 'get_option',            
50           'empty'  => 'has_options',
51           'count'  => 'num_options',
52           'delete' => 'delete_option',
53       }
54   );
55   
56 =head1 DESCRIPTION
57
58 This module provides an Hash attribute which provides a number of 
59 hash-like operations. See L<MooseX::AttributeHelpers::MethodProvider::Hash>
60 for more details.
61
62 =head1 METHODS
63
64 =over 4
65
66 =item B<meta>
67
68 =item B<method_provider>
69
70 =item B<has_method_provider>
71
72 =item B<helper_type>
73
74 =back
75
76 =head1 BUGS
77
78 All complex software has bugs lurking in it, and this module is no 
79 exception. If you find a bug please either email me, or add the bug
80 to cpan-RT.
81
82 =head1 AUTHOR
83
84 Stevan Little E<lt>stevan@iinteractive.comE<gt>
85
86 =head1 COPYRIGHT AND LICENSE
87
88 Copyright 2007-2008 by Infinity Interactive, Inc.
89
90 L<http://www.iinteractive.com>
91
92 This library is free software; you can redistribute it and/or modify
93 it under the same terms as Perl itself.
94
95 =cut