title: Extract values from an array of hashes
body: <p>I need to extract values from an array of hashes:</p>
  
  <pre><code>data =
  [{:diaria_media=&gt;"103.58908136482939632545931759", 
    :room_night=&gt;"1143",
    :valor_periodo=&gt;"118402.320000"},   
   {:diaria_media=&gt;"307.46792079207920792079207921", 
    :room_night=&gt;"101",
    :valor_periodo=&gt;"31054.260000"},
   {:diaria_media=&gt;"313.000000",
    :room_night=&gt;"9",
    :valor_periodo=&gt;"2817.000000"},
   {:diaria_media=&gt;"0.0",
    :room_night=&gt;"7",
    :valor_periodo=&gt;"0.0"},
   {:diaria_media=&gt;"4.4630434782608695652173913043",
    :room_night=&gt;"414",
    :valor_periodo=&gt;"1847.700000"},
   {:diaria_media=&gt;"150.89382627422828427853553482",
    :room_night=&gt;"1393",
    :valor_periodo=&gt;"210195.100000"}, 
   {:diaria_media=&gt;"221.11425992779783393501805054",
    :room_night=&gt;"554",
    :valor_periodo=&gt;"122497.300000"},
   {:diaria_media=&gt;"36.919200",
    :room_night=&gt;"25",
    :valor_periodo=&gt;"922.980000"},
   {:diaria_media=&gt;"31.967530864197530864197530864",
    :room_night=&gt;"81",
    :valor_periodo=&gt;"2589.370000"},
   {:diaria_media=&gt;"0",
    :room_night=&gt;"0",
    :valor_periodo=&gt;"0.000000"}]
  </code></pre>
  
  <p>I need to get all the <code>:room night</code> fields and add the values. What is the best way to achieve that?</p>