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