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