use List::Util;
use List::MoreUtils;
-our $VERSION = '0.89_01';
+our $VERSION = '1.04';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
my ( $attr, $reader, $writer ) = @_;
return sub {
my ( $instance, $predicate ) = @_;
- &List::Util::first($predicate, @{ $reader->($instance) });
+ List::Util::first { $predicate->() } @{ $reader->($instance) };
};
}
return sub {
my ( $instance, $n, $f ) = @_;
my $it = List::MoreUtils::natatime($n, @{ $reader->($instance) });
- if ($f) {
- while (my @vals = $it->()) {
- $f->(@vals);
- }
+ return $it unless $f;
+
+ while (my @vals = $it->()) {
+ $f->(@vals);
}
- $it;
+
+ return;
};
}
=head1 NAME
-Moose::Meta::Attribute::Native::MethodProvider::Array
+Moose::Meta::Attribute::Native::MethodProvider::Array - role providing method generators for Array trait
=head1 DESCRIPTION
This is a role which provides the method generators for
-L<Moose::Meta::Attribute::Trait::Native::Array>. Please check there for
+L<Moose::Meta::Attribute::Native::Trait::Array>. Please check there for
documentation on what methods are provided.
=head1 METHODS
=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