From: Joshua Muheim Date: 2007-11-08T02:36:15+09:00 Subject: Re: Is there a "||" that treats "" also as false? I finally came up with this: class String def |(alternative) (self.nil? or self == "") ? alternative : self end end class NilClass def |(alternative) alternative end end Is this OK? Or do I accidently override some existing method? Because without the definition above nil | "asdf" returns true! -- Posted via http://www.ruby-forum.com/.