Skip to content

Instantly share code, notes, and snippets.

@dominictarr
Created September 24, 2010 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dominictarr/594863 to your computer and use it in GitHub Desktop.
Save dominictarr/594863 to your computer and use it in GitHub Desktop.
ruby 'default' opperator.
foo ||= true
puts foo
foo = nil
foo ||= true
puts foo
foo = false
foo ||= true
puts foo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment