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