title: How do I iterate through a nested array without flattening its contents?
body: <p>I have an array with pairs of numbers:</p>
  
  <pre><code>a = [[4, 6], [3, 0], [0, 0]]
  </code></pre>
  
  <p>When I do:</p>
  
  <pre><code>a.each do |x|
    puts x
  done
  </code></pre>
  
  <p>I get a flattened set of values:</p>
  
  <pre><code>4
  6
  3
  0
  0
  0
  </code></pre>
  
  <p>What I want is for the values to remain in pairs:</p>
  
  <pre><code>[4,6]
  [3,0]
  [0,0]
  </code></pre>
  
  <p>Ideally, I'd like to iterate with an <code>Enumerator</code>, because I'd like to make use of <code>#peek</code> during the loop processing.</p>
  
  <p>I've found that:</p>
  
  <pre><code>e = a.each
  loop do
    puts e.next
  end
  </code></pre>
  
  <p>gives the same output as the flattened example above, with an additional <code>nil</code> at the end. </p>
  
  <p>Is there a way to loop while preserve the grouping of the array in pairs?</p>