line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooseX::AttributeHelpers::Trait::Collection::Hash; |
2
|
22
|
|
|
22
|
|
82
|
use Moose::Role; |
|
22
|
|
|
|
|
27
|
|
|
22
|
|
|
|
|
152
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.25'; |
5
|
|
|
|
|
|
|
|
6
|
22
|
|
|
22
|
|
86248
|
use MooseX::AttributeHelpers::MethodProvider::Hash; |
|
22
|
|
|
|
|
61
|
|
|
22
|
|
|
|
|
1533
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
with 'MooseX::AttributeHelpers::Trait::Collection'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'method_provider' => ( |
11
|
|
|
|
|
|
|
is => 'ro', |
12
|
|
|
|
|
|
|
isa => 'ClassName', |
13
|
|
|
|
|
|
|
predicate => 'has_method_provider', |
14
|
|
|
|
|
|
|
default => 'MooseX::AttributeHelpers::MethodProvider::Hash' |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
|
17
|
2
|
|
|
2
|
1
|
9
|
sub helper_type { 'HashRef' } |
18
|
|
|
|
|
|
|
|
19
|
22
|
|
|
22
|
|
127
|
no Moose::Role; |
|
22
|
|
|
|
|
30
|
|
|
22
|
|
|
|
|
106
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
__END__ |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=pod |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=encoding UTF-8 |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
MooseX::AttributeHelpers::Trait::Collection::Hash |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 VERSION |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
version 0.25 |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 SYNOPSIS |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
package Stuff; |
40
|
|
|
|
|
|
|
use Moose; |
41
|
|
|
|
|
|
|
use MooseX::AttributeHelpers; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
has 'options' => ( |
44
|
|
|
|
|
|
|
metaclass => 'Collection::Hash', |
45
|
|
|
|
|
|
|
is => 'ro', |
46
|
|
|
|
|
|
|
isa => 'HashRef[Str]', |
47
|
|
|
|
|
|
|
default => sub { {} }, |
48
|
|
|
|
|
|
|
provides => { |
49
|
|
|
|
|
|
|
'set' => 'set_option', |
50
|
|
|
|
|
|
|
'get' => 'get_option', |
51
|
|
|
|
|
|
|
'empty' => 'has_options', |
52
|
|
|
|
|
|
|
'count' => 'num_options', |
53
|
|
|
|
|
|
|
'delete' => 'delete_option', |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 DESCRIPTION |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
This module provides a Hash attribute which provides a number of |
60
|
|
|
|
|
|
|
hash-like operations. See L<MooseX::AttributeHelpers::MethodProvider::Hash> |
61
|
|
|
|
|
|
|
for more details. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 METHODS |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=over 4 |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=item B<meta> |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item B<method_provider> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item B<has_method_provider> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item B<helper_type> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=back |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 SUPPORT |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
Bugs may be submitted through L<the RT bug tracker|https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-AttributeHelpers> |
80
|
|
|
|
|
|
|
(or L<bug-MooseX-AttributeHelpers@rt.cpan.org|mailto:bug-MooseX-AttributeHelpers@rt.cpan.org>). |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
There is also a mailing list available for users of this distribution, at |
83
|
|
|
|
|
|
|
L<http://lists.perl.org/list/moose.html>. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
There is also an irc channel available for users of this distribution, at |
86
|
|
|
|
|
|
|
L<C<#moose> on C<irc.perl.org>|irc://irc.perl.org/#moose>. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
=head1 AUTHOR |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Stevan Little <stevan@iinteractive.com> |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This software is copyright (c) 2007 by Stevan Little and Infinity Interactive, Inc. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
97
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |