package Moose::Meta::Attribute::Native::Trait::Array;
use Moose::Role;
-our $VERSION = '1.19';
-$VERSION = eval $VERSION;
-our $AUTHORITY = 'cpan:STEVAN';
-
with 'Moose::Meta::Attribute::Native::Trait';
sub _helper_type { 'ArrayRef' }
1;
+# ABSTRACT: Helper trait for ArrayRef attributes
+
__END__
=pod
-=head1 NAME
-
-Moose::Meta::Attribute::Native::Trait::Array - Helper trait for array delegation
-
=head1 SYNOPSIS
package Stuff;
If the specified element does not exist, this will return C<undef>.
-This method does accepts just one argument.
+This method accepts just one argument.
=item * B<pop>
=item * B<first( sub { ... } )>
-This method returns the first item matching item in the array, just like
+This method returns the first matching item in the array, just like
L<List::Util>'s C<first> function. The matching is done with a subroutine
reference you pass to this method. The subroutine will be called against each
element in the array until one matches or all elements have been checked.
This method requires a single argument.
+=item * B<first_index( sub { ... } )>
+
+This method returns the index of the first matching item in the array, just
+like L<List::MoreUtils>'s C<first_index> function. The matching is done with a
+subroutine reference you pass to this method. The subroutine will be called
+against each element in the array until one matches or all elements have been
+checked.
+
+This method requires a single argument.
+
=item * B<grep( sub { ... } )>
This method returns every element matching a given criteria, just like Perl's
This method accepts one or two arguments.
+=item B<shallow_clone>
+
+This method returns a shallow clone of the array reference. The return value
+is a reference to a new array with the same elements. It is I<shallow>
+because any elements that were references in the original will be the I<same>
+references in the clone.
+
=back
=head1 BUGS
See L<Moose/BUGS> for details on reporting bugs.
-=head1 AUTHOR
-
-Stevan Little E<lt>stevan@iinteractive.comE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright 2007-2009 by Infinity Interactive, Inc.
-
-L<http://www.iinteractive.com>
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself.
-
=cut