Skip to content

Instantly share code, notes, and snippets.

@bakkdoor
Created April 15, 2009 17:23
Show Gist options
  • Save bakkdoor/95913 to your computer and use it in GitHub Desktop.
Save bakkdoor/95913 to your computer and use it in GitHub Desktop.
# 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