Is it possible to implement the ?? operator in Ruby?
a = nil b = 1 x = a ?? b # x should == 1 x = b ?? 2 # x should == 1
There is the coalesce gem, which is as close as you'll get.
nil || 5 # => 5 false || 5 # => 5 :( false._? 5 # => false :)