Joel Pearson wrote in post #1131113:
> I'm curious why you didn't implement this using this approach?
>
> class Object
>   def if
>     self ? yield : self
>   end
>
>   def unless
>     self ? self : yield
>   end
> end
>
> Ruby will automatically raise if you use yield without a block.
> I don't see any need to modify false and nil, since Ruby can already
> test them using "self".
>
> Am I missing something else here?

Different strokes for different folks.  I've have taken the OP's 
approach, too, because we already know for (pretty) certain that all 
objects except nil and false are truthy.  Why bother testing them?

-- 
Posted via http://www.ruby-forum.com/.