Created
October 25, 2013 06:19
-
-
Save timrandg/7150167 to your computer and use it in GitHub Desktop.
block demo for Ben
This file contains 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 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