title: Idiomatic Ruby: data structure transformation
body: <p>What's the "Rubyist" way to do the following data structure transformation:</p>
  
  <p>I have </p>
  
  <pre>
      incoming = [ {:date => 20090501, :width => 2}, 
                   {:date => 20090501, :height => 7}, 
                   {:date => 20090501, :depth => 3}, 
                   {:date => 20090502, :width => 4}, 
                   {:date => 20090502, :height => 6}, 
                   {:date => 20090502, :depth => 2},
                 ]
  </pre>
  
  <p>and I want to collapse these by :date, to end up with</p>
  
  <pre>
      outgoing = [ {:date => 20090501, :width => 2, :height => 7, :depth => 3},
                   {:date => 20090502, :width => 4, :height => 6, :depth => 2},
                 ]
  </pre>
  
  <p>An array of arrays would also be fine at the last step, provided that the columns are in the same order in each row.  Also, importantly, I do not know all the hash keys in advance (that is, I do not know :width, :height, or :depth -- they could be :cats, :dogs, and :hamsters).</p>