If you only want to return the new values, but not add them:
h = Hash.new { |_hash, key| key }
To initially populate this hash, you can do:
h.merge( {1 => "one", 2 => "two"} )
If the hash has already been created *:
h.default_proc = proc do |_hash,key| key end
* only in ruby 1.9 and higher
source share