On Mar 12, 8:39 pm, "Mushfeq Khan" <mushfeq.k... / gmail.com> wrote:
> You can even do:
>
> hashes.inject(Hash.new {|h, k| 0}) {|result, hash| result.merge(hash) {|k,
> e, v| e + v}}

Oh, you beat me to it.  I might add, though, that the parameters in
the initializer block can be safely removed:

hashes.inject(Hash.new {0}) {|memo, hash| memo.merge(hash) {|k,e,v| e
+ v}}

Harrison Reiser