File Coverage

blib/lib/MooseX/AttributeHelpers/Trait/Collection/Array.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 1 1 100.0
total 15 15 100.0


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