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