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