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