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