Advertisement
kremisoski

Ternary If/Else single line statement

Feb 3rd, 2015
301
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.14 KB | None | 0 0
  1. # if/else ternary one line no end required
  2. #boolean ? "if statement" : "else statement"
  3.  
  4. 3 > 4 ? "this can't be true" : "why would it be?"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement