Commit | Line | Data |
7b9312d8 |
1 | |
2 | package MooseX::AttributeHelpers::Trait::Collection::Array; |
3 | use Moose::Role; |
4 | |
4a0da5ad |
5 | our $VERSION = '0.19'; |
cf0d1310 |
6 | $VERSION = eval $VERSION; |
7b9312d8 |
7 | our $AUTHORITY = 'cpan:STEVAN'; |
8 | |
9 | use MooseX::AttributeHelpers::MethodProvider::Array; |
10 | |
11 | with 'MooseX::AttributeHelpers::Trait::Collection'; |
12 | |
13 | has 'method_provider' => ( |
14 | is => 'ro', |
15 | isa => 'ClassName', |
16 | predicate => 'has_method_provider', |
17 | default => 'MooseX::AttributeHelpers::MethodProvider::Array' |
18 | ); |
19 | |
20 | sub helper_type { 'ArrayRef' } |
21 | |
22 | no Moose::Role; |
23 | |
24 | # register the alias ... |
25 | package # hide me from search.cpan.org |
26 | Moose::Meta::Attribute::Custom::Trait::Collection::Array; |
27 | sub register_implementation { |
28 | 'MooseX::AttributeHelpers::Trait::Collection::Array' |
29 | } |
30 | |
31 | |
32 | 1; |
33 | |
34 | __END__ |
35 | |
36 | =pod |
37 | |
38 | =head1 NAME |
39 | |
40 | MooseX::AttributeHelpers::Collection::Array |
41 | |
42 | =head1 SYNOPSIS |
43 | |
44 | package Stuff; |
45 | use Moose; |
46 | use MooseX::AttributeHelpers; |
47 | |
48 | has 'options' => ( |
49 | metaclass => 'Collection::Array', |
50 | is => 'ro', |
51 | isa => 'ArrayRef[Int]', |
52 | default => sub { [] }, |
53 | provides => { |
54 | 'push' => 'add_options', |
55 | 'pop' => 'remove_last_option', |
56 | } |
57 | ); |
58 | |
59 | =head1 DESCRIPTION |
60 | |
61 | This module provides an Array attribute which provides a number of |
62 | array operations. See L<MooseX::AttributeHelpers::MethodProvider::Array> |
63 | for more details. |
64 | |
65 | =head1 METHODS |
66 | |
67 | =over 4 |
68 | |
69 | =item B<meta> |
70 | |
71 | =item B<method_provider> |
72 | |
73 | =item B<has_method_provider> |
74 | |
75 | =item B<helper_type> |
76 | |
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 | |
9c5d164e |
91 | Copyright 2007-2009 by Infinity Interactive, Inc. |
7b9312d8 |
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 |