From: Bill Kelly Date: 2010-04-13T02:02:36+09:00 Subject: Re: attr_accessor, but for a boolean Intransition wrote: >> >> This way the expectation of a ? method to return a boolean is preserved. > > I used to think this too, but... I think it was Austin Ziegler who > made the argument against using anything like "!!". In ruby it isn't > necessary. Anything that isn't nil or false is evaluated by > conditionals as true. I haven't once seen a case where it mattered if > a boolean was returned rather than the underlying value. In a DRb situation, I'd rather send 'true' across the wire than an arbitrary object. Also, if the boolean value is going to be stored somewhere, I'd rather store a 'true' than reference an arbitrary object. Also, if I'm adding a temporary debug printout #{someval.inspect} it's nicer to see true/false in the output. Regards, Bill