use strict;
use warnings;
-use List::MoreUtils;
+use List::MoreUtils ();
+use Params::Util ();
-our $VERSION = '1.13';
+our $VERSION = '1.17';
$VERSION = eval $VERSION;
our $AUTHORITY = 'cpan:STEVAN';
-use base 'Moose::Meta::Method::Accessor::Native::Array::Reader';
+use Moose::Role;
+
+with 'Moose::Meta::Method::Accessor::Native::Reader' => {
+ -excludes => [
+ qw(
+ _minimum_arguments
+ _maximum_arguments
+ _inline_check_arguments
+ _inline_return_value
+ )
+ ]
+};
sub _minimum_arguments {1}
. ' unless defined $_[0] && $_[0] =~ /^\\d+$/;' . "\n"
. $self->_inline_throw_error(
q{'The second argument passed to natatime must be a code reference'})
- . q{ if defined $_[1] && ( ref $_[1] || q{} ) ne 'CODE';};
+ . q{ if @_ == 2 && ! Params::Util::_CODELIKE( $_[1] );};
}
sub _inline_return_value {
my ( $self, $slot_access ) = @_;
return
- "my \$iter = List::MoreUtils::natatime( \$_[0], \@{ $slot_access } );"
+ "my \$iter = List::MoreUtils::natatime( \$_[0], \@{ ($slot_access) } );"
. "\n"
. 'if ( $_[1] ) {' . "\n"
. 'while (my @vals = $iter->()) {' . "\n"
. 'return $iter;' . "\n" . '}';
}
+# Not called, but needed to satisfy the Reader role
+sub _return_value { }
+
+no Moose::Role;
+
1;