File Coverage

blib/lib/MooseX/AttributeHelpers/Trait/Collection/ImmutableHash.pm
Criterion Covered Total %
statement 9 10 90.0
branch n/a
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 13 15 86.6


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