prep next release
[gitmo/Moose-Autobox.git] / lib / Moose / Autobox / Hash.pm
index 67f94b1..2ec40e3 100644 (file)
@@ -1,7 +1,7 @@
 package Moose::Autobox::Hash;
 use Moose::Role 'with';
 
-our $VERSION = '0.09';
+our $VERSION = '0.13';
 
 with 'Moose::Autobox::Ref',
      'Moose::Autobox::Indexed';
@@ -81,6 +81,18 @@ sub each_value {
     $sub->($_) for CORE::values %$hash;
 }
 
+sub each_n_values {
+    my ($hash, $n, $sub) = @_;
+    my @keys = CORE::keys %$hash;
+    my $it = List::MoreUtils::natatime($n, @keys);
+
+    while (my @vals = $it->()) {
+        $sub->(@$hash{ @vals });
+    }
+
+    return;
+}
+
 
 # End Indexed
 
@@ -144,6 +156,14 @@ Slices a hash but returns the keys and values as a new hashref.
 
 =item B<slice>
 
+=item B<each>
+
+=item B<each_key>
+
+=item B<each_value>
+
+=item B<each_n_values>
+
 =back
 
 =over 4