From: Phrogz Date: 2006-10-18T05:05:21+09:00 Subject: Re: ruby way to say this? On Oct 17, 2:00 pm, Simon Kr�ger wrote: > Well, most of the time just ask ruby to do what you want: > > oneThing.nonzero? || otherThing > > -------------------------------------------------------------------------- > num.nonzero? => num or nil > > Returns num if num is not zero, nil otherwise. This behavior is useful when > chaining comparisons: Bah! You have to come up with the easy answer and spoil all of our fun, don't you?