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