title: Sum hash with the same key values
body: <p>I have an array of hashes</p>
  
  <pre><code>[
    {:source=&gt;"LOREM", :net_revenue="100"},
    {:source=&gt;"LOREM", :net_revenue="100"},
    {:source=&gt;"IPSUM", :net_revenue="100"}
  ]
  </code></pre>
  
  <p>How do I sum the hashes with the same value (<code>"LOREM"</code>) of the key (<code>:source</code>) to get the following result?</p>
  
  <pre><code>[
    {:source=&gt;"LOREM", :net_revenue="200"},
    {:source=&gt;"IPSUM", :net_revenue="100"}
  ]
  </code></pre>
  
  <p>Tried this <code>arr_of_hashes.inject{|a,b| a.merge(b){|_,x,y| x + y}}</code> but got </p>
  
  <pre><code>[
    {:source=&gt;"LOREMLOREM", :net_revenue="100"},
    {:source=&gt;"IPSUM", :net_revenue="100"}
  ]
  </code></pre>