From: Nick Brown Date: 2010-03-06T06:36:43+09:00 Subject: Re: Conditional keys in hash - out of the box? >>> mymethod(h = {:this => 'green'} && condition ? h.merge({:that => >>> 'blue'}) : h) >> >> You could also do it this way: >> >> method {:Apples => 1}.merge(condition ? {:Oranges => 2} : {}) For the love of all that is good and holy, please do not try to cram two elegant lines of code into one disgusting line. That way lies madness... ;-) -- Posted via http://www.ruby-forum.com/.