Commit | Line | Data |
22d869ff |
1 | |
2 | package MooseX::AttributeHelpers::Collection::Array; |
3 | use Moose; |
22d869ff |
4 | |
5 | our $VERSION = '0.01'; |
6 | our $AUTHORITY = 'cpan:STEVAN'; |
7 | |
b9dc8e2f |
8 | use MooseX::AttributeHelpers::MethodProvider::Array; |
d26633fc |
9 | |
b9dc8e2f |
10 | extends 'MooseX::AttributeHelpers::Collection'; |
8ba40fb0 |
11 | |
b9dc8e2f |
12 | has '+method_provider' => ( |
13 | default => 'MooseX::AttributeHelpers::MethodProvider::Array' |
22d869ff |
14 | ); |
15 | |
b9dc8e2f |
16 | sub helper_type { 'ArrayRef' } |
17 | |
22d869ff |
18 | no Moose; |
22d869ff |
19 | |
20 | # register the alias ... |
d26633fc |
21 | package Moose::Meta::Attribute::Custom::Collection::Array; |
22d869ff |
22 | sub register_implementation { 'MooseX::AttributeHelpers::Collection::Array' } |
23 | |
24 | |
25 | 1; |
26 | |
27 | __END__ |
28 | |
29 | =pod |
30 | |
31 | =head1 NAME |
32 | |
5431dff2 |
33 | MooseX::AttributeHelpers::Collection::Array |
34 | |
22d869ff |
35 | =head1 SYNOPSIS |
36 | |
37 | package Stuff; |
38 | use Moose; |
5431dff2 |
39 | use MooseX::AttributeHelpers; |
22d869ff |
40 | |
41 | has 'options' => ( |
457dc4fb |
42 | metaclass => 'Collection::Array', |
22d869ff |
43 | is => 'ro', |
8c651099 |
44 | isa => 'ArrayRef[Int]', |
22d869ff |
45 | default => sub { [] }, |
46 | provides => { |
47 | 'push' => 'add_options', |
48 | 'pop' => 'remove_last_option', |
49 | } |
50 | ); |
51 | |
52 | =head1 DESCRIPTION |
53 | |
5431dff2 |
54 | This module provides an Array attribute which provides a number of |
55 | array operations. See L<MooseX::AttributeHelpers::MethodProvider::Array> |
56 | for more details. |
57 | |
22d869ff |
58 | =head1 METHODS |
59 | |
5431dff2 |
60 | =over 4 |
61 | |
62 | =item B<method_provider> |
63 | |
64 | =item B<has_method_provider> |
65 | |
66 | =item B<helper_type> |
67 | |
68 | =back |
69 | |
22d869ff |
70 | =head1 BUGS |
71 | |
72 | All complex software has bugs lurking in it, and this module is no |
73 | exception. If you find a bug please either email me, or add the bug |
74 | to cpan-RT. |
75 | |
76 | =head1 AUTHOR |
77 | |
78 | Stevan Little E<lt>stevan@iinteractive.comE<gt> |
79 | |
80 | =head1 COPYRIGHT AND LICENSE |
81 | |
82 | Copyright 2007 by Infinity Interactive, Inc. |
83 | |
84 | L<http://www.iinteractive.com> |
85 | |
86 | This library is free software; you can redistribute it and/or modify |
87 | it under the same terms as Perl itself. |
88 | |
8a9cea9b |
89 | =cut |