Skip to content

Instantly share code, notes, and snippets.

@timrandg
Created October 25, 2013 06:19
Show Gist options
  • 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