Commit | Line | Data |
22d869ff |
1 | |
2 | package MooseX::AttributeHelpers::Collection::Hash; |
d26633fc |
3 | use Moose; |
22d869ff |
4 | |
7a93b96e |
5 | our $VERSION = '0.14'; |
38430345 |
6 | $VERSION = eval $VERSION; |
22d869ff |
7 | our $AUTHORITY = 'cpan:STEVAN'; |
8 | |
65a43f48 |
9 | use MooseX::AttributeHelpers::MethodProvider::Hash; |
d26633fc |
10 | |
65a43f48 |
11 | extends 'MooseX::AttributeHelpers::Collection'; |
8ba40fb0 |
12 | |
65a43f48 |
13 | has '+method_provider' => ( |
14 | default => 'MooseX::AttributeHelpers::MethodProvider::Hash' |
d26633fc |
15 | ); |
16 | |
65a43f48 |
17 | sub helper_type { 'HashRef' } |
18 | |
d26633fc |
19 | no Moose; |
20 | |
21 | # register the alias ... |
0f31cc28 |
22 | package # hide me from search.cpan.org |
23 | Moose::Meta::Attribute::Custom::Collection::Hash; |
d26633fc |
24 | sub register_implementation { 'MooseX::AttributeHelpers::Collection::Hash' } |
25 | |
26 | |
22d869ff |
27 | 1; |
28 | |
29 | __END__ |
30 | |
31 | =pod |
32 | |
33 | =head1 NAME |
34 | |
5431dff2 |
35 | MooseX::AttributeHelpers::Collection::Hash |
36 | |
22d869ff |
37 | =head1 SYNOPSIS |
38 | |
5431dff2 |
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 | |
22d869ff |
57 | =head1 DESCRIPTION |
58 | |
9a976497 |
59 | This module provides an Hash attribute which provides a number of |
60 | hash-like operations. See L<MooseX::AttributeHelpers::MethodProvider::Hash> |
5431dff2 |
61 | for more details. |
62 | |
22d869ff |
63 | =head1 METHODS |
64 | |
5431dff2 |
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 | |
22d869ff |
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 | |
99c62fb8 |
89 | Copyright 2007-2008 by Infinity Interactive, Inc. |
22d869ff |
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 | |
1ccccb1f |
96 | =cut |