Rubyisms
Ternary Operations
Not Ruby specific, but cool nonetheless:
x = barf == "blah" ? 30 : 60
This means, if barf is equal to "blah", then set x to 30, otherwise set x to 60.
Nil Test
something.nil?
Not Ruby specific, but cool nonetheless:
x = barf == "blah" ? 30 : 60
This means, if barf is equal to "blah", then set x to 30, otherwise set x to 60.
something.nil?