Hmm. I think I did something odd in here...
[gitmo/MooseX-AttributeHelpers.git] / lib / MooseX / AttributeHelpers / Collection / ImmutableHash.pm
1
2 package MooseX::AttributeHelpers::Collection::ImmutableHash;
3 use Moose;
4 use MooseX::AttributeHelpers::Sugar;
5
6 our $VERSION   = '0.01';
7 our $AUTHORITY = 'cpan:STEVAN';
8
9 extends 'MooseX::AttributeHelpers::Collection';
10
11 define_attribute_helper (
12     helper_type      => 'HashRef',
13     method_provider  => 
14         'MooseX::AttributeHelpers::MethodProvider::ImmutableHash',
15     shortcut         => 'Collection::ImmutableHash',
16 );
17
18 no Moose;
19 no MooseX::AttributeHelpers::Sugar;
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 
52 hash-like operations. 
53
54 =head1 PROVIDED METHODS
55
56 The methods for this metaclass are provided by
57 L<MooseX::AttributeHelpers::MethodProvider::ImmutableHash>.
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
71 Copyright 2007-2008 by Infinity Interactive, Inc.
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
78 =cut