From: Trans Date: 2008-10-27T08:09:27+09:00 Subject: Re: Hash.merge_add! extension - how does this code look? On Oct 26, 5:45 pm, Stefan Rusterholz wrote: > Reading your problem and code I think you missed that Hash#merge > optionally takes a block which seems to solve your issue just fine but > in a more generic manner: > > hash = {'foo' => 'bar1'} > hash.merge! 'foo' => 'bar2' do |key, existing, new| >   Array(existing) + [new] > end > p hash # -> {"foo"=>["bar1", "bar2"]} Nice. I didn't know it could take a block either. Has that been there all along? T.