package Moose::Meta::Attribute::Native::Trait::Array;
use Moose::Role;
-our $VERSION = '0.89';
+our $VERSION = '1.08';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
=head1 NAME
-Moose::Meta::Attribute::Native::Trait::Array
+Moose::Meta::Attribute::Native::Trait::Array - Helper trait for ArrayRef attributes
=head1 SYNOPSIS
is => 'ro',
isa => 'ArrayRef[Str]',
default => sub { [] },
- handles => {
- all_options => 'elements',
- map_options => 'map',
- filter_options => 'grep',
- find_option => 'first',
- get_option => 'get',
- join_options => 'join',
- count_options => 'count',
- has_no_options => 'is_empty',
- sorted_options => 'sort',
- }
+ handles => {
+ all_options => 'elements',
+ add_option => 'push',
+ map_options => 'map',
+ filter_options => 'grep',
+ find_option => 'first',
+ get_option => 'get',
+ join_options => 'join',
+ count_options => 'count',
+ has_options => 'count',
+ has_no_options => 'is_empty',
+ sorted_options => 'sort',
+ },
);
no Moose;
=item B<is_empty>
-Returns a boolean value indicating whether or not the array has any elements.
+Returns a boolean value that is true when the array has no elements.
$stuff->has_no_options ? die "No options!\n" : print "Good boy.\n";
=item B<pop>
-=item B<push($value)>
+=item B<push($value1, $value2, value3 ...)>
=item B<shift>
-=item B<unshift($value)>
+=item B<unshift($value1, $value2, value3 ...)>
=item B<splice($offset, $length, @values)>
=head1 BUGS
-All complex software has bugs lurking in it, and this module is no
-exception. If you find a bug please either email me, or add the bug
-to cpan-RT.
+See L<Moose/BUGS> for details on reporting bugs.
=head1 AUTHOR