cube-tube/app/util/coalesce.rb
Gordon Pedersen 9c0fe1b8dc Minor fixes and updates for iOS
including moving some files into the app folder instead of where it was perviously
2023-05-08 14:51:26 +10:00

18 lines
296 B
Ruby

# Handy null coalesing operator, taken from
# https://github.com/kibiz0r/coalesce/blob/bc4389ae8a8bb456cd10ec8a3523df1fc775124f/lib/coalesce.rb
class Object
def _?(x = nil)
self
end
end
class NilClass
def _?(x = nil)
if block_given?
yield
else
x
end
end
end