From: Joel Pearson Date: 2013-03-29T19:12:22+09:00 Subject: Re: Hash with default Well, if you really wanted to do it all in one go then this might work: h = Hash.new {|x,y| if some_condition x[y] = 'moose' else x[y] = y end } -- Posted via http://www.ruby-forum.com/.