"if object" works but its a trivial example. in more complex scenarios
like:
if you_are_happy? && object a&& object.is_feeling_funky?
object.do_something
end
Sure it works...but it loses its meaning. The less mental translation
i need to make the better...code should be easy to read. the implicit
behavior of "if object" in many contexts is not sufficient.
On Dec 13, 3:59 pm, Jeff <[EMAIL PROTECTED]> wrote:
> matthew deiters wrote:
> > Ever need to do !object.nil? - I do and frequently. This patch is
> > basically rolling up an extension i end up adding to every project i
> > work on.
>
> Um... why not just do
>
> if object ....
>
> Should be the same as !object.nil?, right?
>
> Jeff
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---