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