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