Created
August 24, 2018 13:57
-
-
Save mehdi-farsi/93121e05862f77c6dfe2435d9491bc9b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def optional_block | |
yield if block_given? | |
end | |
optional_block # => nil | |
optional_block { puts 'optional block' } # => optional block |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment