Created
April 15, 2009 17:23
-
-
Save bakkdoor/95913 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
# this method requires a block | |
# if called without passing one, a compiler error / warning could be shown | |
def my_method_with_required_block(param1, param2, *params) [block] | |
# do stuff here with block, like calling it: | |
block.call("calling block") | |
# or call it with yield: | |
yield("calling block") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment