Ruby equivalent of Groovy's Elvis (?:) operator?
Never mind :-) I just found the answer myself after finding out the name of the operator.
From here:
PARAM = ARGV[0] || 'default'
(Must be 'cause I'm juggling 4 languages right now so I forgot I could do that in the first place.)
Isn't PARAM = ARGV[0] ? ARGV[0] : 'default'
the same as PARAM = (ARGV[0] || 'default')
?
Possible since Ruby 2.3
.
dog&.owner&.phone