From: Peter Zotov Date: 2012-07-04T08:46:59+09:00 Subject: Re: if x.condition, set x to y wutang paul писал 04.07.2012 03:43: > Hi, big time newbie here. > > > if actor_data['biography'].empty? > actor_data['biography'] = "Biography not available" > end > > Is there a shorter/better way to do this? > > Thanks for your help! if actor_data['biography'].nil? actor_data['biography'] = "Biography not available" end is the same as actor_data['biography'] ||= "Biography not available" There is no shortcut for #empty? that I know, and probably no at all. -- WBR, Peter Zotov.