457921c7ec44c98e7c517cf4f839123d456e90cd
[gitmo/MooseX-AttributeHelpers.git] / lib / MooseX / AttributeHelpers / Collection / Array.pm
1
2 package MooseX::AttributeHelpers::Collection::Array;
3 use Moose;
4
5 our $VERSION   = '0.11';
6 our $AUTHORITY = 'cpan:STEVAN';
7
8 use MooseX::AttributeHelpers::MethodProvider::Array;
9
10 extends 'MooseX::AttributeHelpers::Collection';
11
12 has '+method_provider' => (
13     default => 'MooseX::AttributeHelpers::MethodProvider::Array'
14 );
15
16 sub helper_type { 'ArrayRef' }
17
18 no Moose;
19
20 # register the alias ...
21 package # hide me from search.cpan.org
22     Moose::Meta::Attribute::Custom::Collection::Array;
23 sub register_implementation { 'MooseX::AttributeHelpers::Collection::Array' }
24
25
26 1;
27
28 __END__
29
30 =pod
31
32 =head1 NAME
33
34 MooseX::AttributeHelpers::Collection::Array
35
36 =head1 SYNOPSIS
37
38   package Stuff;
39   use Moose;
40   use MooseX::AttributeHelpers;
41   
42   has 'options' => (
43       metaclass => 'Collection::Array',
44       is        => 'ro',
45       isa       => 'ArrayRef[Int]',
46       default   => sub { [] },
47       provides  => {
48           'push' => 'add_options',
49           'pop'  => 'remove_last_option',
50       }
51   );
52
53 =head1 DESCRIPTION
54
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
59 =head1 METHODS
60
61 =over 4
62
63 =item B<meta>
64
65 =item B<method_provider>
66
67 =item B<has_method_provider>
68
69 =item B<helper_type>
70
71 =back
72
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
85 Copyright 2007-2008 by Infinity Interactive, Inc.
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
92 =cut