Skip to content

Instantly share code, notes, and snippets.

@maxd
Created March 10, 2016 08:40
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 maxd/76e924d147d60cdc003c to your computer and use it in GitHub Desktop.
Save maxd/76e924d147d60cdc003c to your computer and use it in GitHub Desktop.
if-else and ternary operator in Ruby
2.1.5 :017 > puts (if true then 1 else 0 end)
1
=> nil
2.1.5 :018 > puts (true ? 1 : 0)
1
=> nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment