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