Skip to content

Instantly share code, notes, and snippets.

@davetron5000
Created February 13, 2020 13:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davetron5000/ebbbaca8d82e5d9996d9af512ffa05b3 to your computer and use it in GitHub Desktop.
Save davetron5000/ebbbaca8d82e5d9996d9af512ffa05b3 to your computer and use it in GitHub Desktop.
class BasicObject
def or_else(value, &block)
if self.nil?
if block.nil?
value
else
block.()
end
else
self
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment