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