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 | |
fafc8b9b |
11 | with 'Moose::Meta::Attribute::Trait::Native'; |
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 | 1; |
25 | |
26 | __END__ |
27 | |
28 | =pod |
29 | |
30 | =head1 NAME |
31 | |
a40b446a |
32 | Moose::Meta::Attribute::Trait::Native::Hash |
e3c07b19 |
33 | |
34 | =head1 SYNOPSIS |
35 | |
36 | package Stuff; |
37 | use Moose; |
38 | use Moose::AttributeHelpers; |
39 | |
40 | has 'options' => ( |
a40b446a |
41 | metaclass => 'Hash', |
e3c07b19 |
42 | is => 'ro', |
43 | isa => 'HashRef[Str]', |
44 | default => sub { {} }, |
5f3663b2 |
45 | handles => { |
46 | set_option => 'set', |
47 | get_option => 'get', |
48 | has_options => 'empty', |
49 | num_options => 'count', |
50 | delete_option => 'delete', |
e3c07b19 |
51 | } |
52 | ); |
53 | |
54 | =head1 DESCRIPTION |
55 | |
56 | This module provides a Hash attribute which provides a number of |
a40b446a |
57 | hash-like operations. See L<Moose::Meta::Attribute::Trait::Native::MethodProvider::Hash> |
e3c07b19 |
58 | for more details. |
59 | |
60 | =head1 METHODS |
61 | |
62 | =over 4 |
63 | |
64 | =item B<meta> |
65 | |
66 | =item B<method_provider> |
67 | |
68 | =item B<has_method_provider> |
69 | |
e3c07b19 |
70 | =back |
71 | |
72 | =head1 BUGS |
73 | |
74 | All complex software has bugs lurking in it, and this module is no |
75 | exception. If you find a bug please either email me, or add the bug |
76 | to cpan-RT. |
77 | |
78 | =head1 AUTHOR |
79 | |
80 | Stevan Little E<lt>stevan@iinteractive.comE<gt> |
81 | |
82 | =head1 COPYRIGHT AND LICENSE |
83 | |
84 | Copyright 2007-2009 by Infinity Interactive, Inc. |
85 | |
86 | L<http://www.iinteractive.com> |
87 | |
88 | This library is free software; you can redistribute it and/or modify |
89 | it under the same terms as Perl itself. |
90 | |
91 | =cut |