From: Joel VanderWerf Date: 2006-09-09T06:53:59+09:00 Subject: Re: Combine @item.foo.nil? || @item.foo.empty? ? Matthew Moss wrote: >> tr do >> td @item.foo >> end unless (@item.foo.nil? || @item.foo.empty?) >> >> Is there a way to combine these two OR clauses into one? > > > Define a method on the class of foo? > > class Foo ^^^ Object > def nil_or_empty? > return nil? || empty? > end > end Otherwise it won't be defined when foo==nil. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407