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