Skip to content

Instantly share code, notes, and snippets.

@rap1ds
Created March 18, 2014 10:45
Show Gist options
  • Save rap1ds/9617719 to your computer and use it in GitHub Desktop.
Save rap1ds/9617719 to your computer and use it in GitHub Desktop.
## Yield
def try
yield if block_given?
end
## Call
def try(&block)
block.call if block
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment