On Tue, Nov 6, 2012 at 5:29 PM, Jermaine O. <lists / ruby-forum.com> wrote:

> > The same thing can be achieved with Enumerable#inject, which is the
> > generalization of this kind of "sum up the elements of a collection":
>
> Just what I need. Many thanks for this, works great. Appreciate it!
>

I'd rather use Set here since apparently entries must be present only once:

require 'set'

merged = Hash.new {|h,k| h[k] = Set.new}

hashes.each do |hash|
  hash.each {|k, v| merged[k].merge(v)}
end

Cheers

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/