Commit | Line | Data |
---|---|---|
22d869ff | 1 | |
2 | package MooseX::AttributeHelpers::Collection::Array; | |
3 | use Moose; | |
22d869ff | 4 | |
1ccccb1f | 5 | our $VERSION = '0.11'; |
22d869ff | 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 ... | |
0f31cc28 | 21 | package # hide me from search.cpan.org |
22 | 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 | ||
5431dff2 | 34 | MooseX::AttributeHelpers::Collection::Array |
35 | ||
22d869ff | 36 | =head1 SYNOPSIS |
37 | ||
38 | package Stuff; | |
39 | use Moose; | |
5431dff2 | 40 | use MooseX::AttributeHelpers; |
22d869ff | 41 | |
42 | has 'options' => ( | |
457dc4fb | 43 | metaclass => 'Collection::Array', |
22d869ff | 44 | is => 'ro', |
8c651099 | 45 | isa => 'ArrayRef[Int]', |
22d869ff | 46 | default => sub { [] }, |
47 | provides => { | |
48 | 'push' => 'add_options', | |
49 | 'pop' => 'remove_last_option', | |
50 | } | |
51 | ); | |
52 | ||
53 | =head1 DESCRIPTION | |
54 | ||
5431dff2 | 55 | This module provides an Array attribute which provides a number of |
56 | array operations. See L<MooseX::AttributeHelpers::MethodProvider::Array> | |
57 | for more details. | |
58 | ||
22d869ff | 59 | =head1 METHODS |
60 | ||
5431dff2 | 61 | =over 4 |
62 | ||
b91f57af | 63 | =item B<meta> |
64 | ||
5431dff2 | 65 | =item B<method_provider> |
66 | ||
67 | =item B<has_method_provider> | |
68 | ||
69 | =item B<helper_type> | |
70 | ||
71 | =back | |
72 | ||
22d869ff | 73 | =head1 BUGS |
74 | ||
75 | All complex software has bugs lurking in it, and this module is no | |
76 | exception. If you find a bug please either email me, or add the bug | |
77 | to cpan-RT. | |
78 | ||
79 | =head1 AUTHOR | |
80 | ||
81 | Stevan Little E<lt>stevan@iinteractive.comE<gt> | |
82 | ||
83 | =head1 COPYRIGHT AND LICENSE | |
84 | ||
99c62fb8 | 85 | Copyright 2007-2008 by Infinity Interactive, Inc. |
22d869ff | 86 | |
87 | L<http://www.iinteractive.com> | |
88 | ||
89 | This library is free software; you can redistribute it and/or modify | |
90 | it under the same terms as Perl itself. | |
91 | ||
8a9cea9b | 92 | =cut |