Skip to content

Instantly share code, notes, and snippets.

@timrandg
Created October 25, 2013 06:19
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 timrandg/7150167 to your computer and use it in GitHub Desktop.
Save timrandg/7150167 to your computer and use it in GitHub Desktop.
block demo for Ben
def test_blocks(some_obj)
yield some_obj #remember you could add parenthesis to make it read yield(some_obj).
end
test_blocks(10){|so| puts so}
test_blocks('hello, world'){|so| puts so}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment