New to ruby, exploring the teranary operator.
This works just as expected:
5==5? "x" : "y"
returns "x", as everything in ruby is an expression.
But, this doesn't...
user.birthday? "x" : "y"
It's suppose to check if birthday is nil, and return the appropriate string. But it gives me a syntax error:
syntax error, unexpected ':', expecting $end
user.birthday? "x" : "y"
^
What's so different about this statement comapred to the other?
Thanks