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