From: wutang paul Date: 2012-07-09T20:54:38+09:00 Subject: Re: if x.condition, set x to y Robert Klemme wrote in post #1067316: > %w{name biography country}.each do |field| > printf "%-20s: %s\n", field, actor_data[field] || "#{field} not > available" > end > > or just > > %w{name biography country}.each do |field| > printf "%-20s: %s\n", field, actor_data[field] || 'not available' > end > > Btw wutang, IRB is a great too to try these things out. I like your approach Robert, it would work particularly well for my use case. Thanks for the reminder about IRB too, I was wasting time editing, running and outputting to console. I'll get the hang of this wonderful language eventually! -- Posted via http://www.ruby-forum.com/.