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