Skip to content

Instantly share code, notes, and snippets.

@garethrees
Created August 3, 2012 13:12
Show Gist options
  • Select an option

  • Save garethrees/3247597 to your computer and use it in GitHub Desktop.

Select an option

Save garethrees/3247597 to your computer and use it in GitHub Desktop.
Ternary
# In Ruby you can do this:
if something then do_this else do_that
# Which is the same as:
something ? do_this : do_that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment