From: Patrick Gundlach Date: 2005-07-26T03:15:58+09:00 Subject: Re: Newby question 'unless' Hello David, > Conditionals give you nil when they're not met, and nil.to_s is an > empty string, so you don't have to specify a literal empty string in > cases like this. Sure, but not in the case I posted: > def to_s > "#{@a}" + (@a == 0 ? "" : "#{@b}" ) > end -:4:in `+': cannot convert nil into String (TypeError) from -:4:in `to_s' from -:8 > "#{@a}#{@b unless @a.zero?}" This is indeed much better. Thanks for your advice - I can see my ruby skills getting better every day. Patrick