On 11/03/2009, at 11:20 AM, Christopher Robbie wrote:

> c = a || b
>
> if 'a' is got something, use it, if 'a' is nil(or false) then use 'b'.
> love it.

c ||= a

c = a, but only if c is nil

def do_something options
   options[:width] ||= 800
   options[:align] ||= :left_justify



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" 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/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to