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