From: Daniel Sheppard Date: 2007-09-26T16:07:34+09:00 Subject: Re: merge two arrays into a hash > require 'generator' > h = {} > SyncEnumerator.new(key, value).each{|i| h[i[0]] = (i[1]|| "")} > p h > => {'1'=>'a', '2'=>'b', '3'=>''} When an array is being passed to a block, you can just provide args for the whole array: SyncEnumerator.new(key, value).each{|k,v| h[k] = v||''} Gives you the same result.