I know I can live without it, but the question's been bugging me.
Is there a Ruby idiom that's equivalent to Groovy's Elvis operator (?:
)?
Essentially, I want to be able to shorten this
PARAM = ARGV[0] ? ARGV[0] : 'default'
Or equivalently
PARAM = 'default' unless PARAM = ARGV[0]
Into something like this
PARAM = ARGV[0] ?: 'default'