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