Merge branch 'master' into traits
[gitmo/MooseX-AttributeHelpers.git] / lib / MooseX / AttributeHelpers / Trait / Collection / ImmutableHash.pm
CommitLineData
7bf3c9a7 1
2package MooseX::AttributeHelpers::Trait::Collection::ImmutableHash;
3use Moose::Role;
4
5our $VERSION = '0.01';
6our $AUTHORITY = 'cpan:STEVAN';
7
8use MooseX::AttributeHelpers::MethodProvider::ImmutableHash;
9
10with 'MooseX::AttributeHelpers::Trait::Collection';
11
12has 'method_provider' => (
13 is => 'ro',
14 isa => 'ClassName',
15 predicate => 'has_method_provider',
16 default => 'MooseX::AttributeHelpers::MethodProvider::ImmutableHash'
17);
18
19sub helper_type { 'HashRef' }
20
21no Moose::Role;
22
23# register the alias ...
24package # hide me from search.cpan.org
25 Moose::Meta::Attribute::Custom::Trait::Collection::ImmutableHash;
26sub register_implementation {
27 'MooseX::AttributeHelpers::Trait::Collection::ImmutableHash'
28}
29
30
311;
32
33__END__
34
35=pod
36
37=head1 NAME
38
39MooseX::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
61This module provides a immutable HashRef attribute which provides a number of
62hash-line operations. See L<MooseX::AttributeHelpers::MethodProvider::ImmutableHash>
63for 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
81All complex software has bugs lurking in it, and this module is no
82exception. If you find a bug please either email me, or add the bug
83to cpan-RT.
84
85=head1 AUTHOR
86
87Stevan Little E<lt>stevan@iinteractive.comE<gt>
88
89=head1 COPYRIGHT AND LICENSE
90
91Copyright 2007-2008 by Infinity Interactive, Inc.
92
93L<http://www.iinteractive.com>
94
95This library is free software; you can redistribute it and/or modify
96it under the same terms as Perl itself.
97
98=cut
99