From: Ricardo Signes Date: Fri, 23 Apr 2010 20:20:52 +0000 (-0400) Subject: each_n -> each_n_values X-Git-Tag: 0.11~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=450776ec2e1c0dfb86abb4b707cb1bfcd7900e57;p=gitmo%2FMoose-Autobox.git each_n -> each_n_values --- diff --git a/lib/Moose/Autobox/Array.pm b/lib/Moose/Autobox/Array.pm index ab28fbf..1221e17 100644 --- a/lib/Moose/Autobox/Array.pm +++ b/lib/Moose/Autobox/Array.pm @@ -134,7 +134,7 @@ sub each_value { $sub->($_) for @$array; } -sub each_n { +sub each_n_values { my ($array, $n, $sub) = @_; my $it = List::MoreUtils::natatime($n, @$array); @@ -246,7 +246,7 @@ This is a role to describe operations on the Array type. =item B -=item B +=item B =back diff --git a/t/011_each_n.t b/t/011_each_n_values.t similarity index 79% rename from t/011_each_n.t rename to t/011_each_n_values.t index 396f446..4f9dc29 100644 --- a/t/011_each_n.t +++ b/t/011_each_n_values.t @@ -11,7 +11,7 @@ use Moose::Autobox; { my @vals; - @array->each_n(2, sub { push @vals, [@_] }); + @array->each_n_values(2, sub { push @vals, [@_] }); is(scalar @vals, 13); is(scalar @$_, 2) for @vals; is_deeply(@vals->map(sub { @{ $_ } }), [@array]); @@ -19,7 +19,7 @@ use Moose::Autobox; { my @vals; - $aref->each_n(2, sub { push @vals, [@_] }); + $aref->each_n_values(2, sub { push @vals, [@_] }); is(scalar @vals, 13); is(scalar @$_, 2) for @vals; is_deeply(@vals->map(sub { @{ $_ } }), $aref);