Created
July 27, 2012 04:54
-
-
Save ananfang/3186238 to your computer and use it in GitHub Desktop.
The yield statement: Block associates to method call
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
# Associate to a method call with no parameter | |
just_say_hi { puts 'Hi!'} | |
# Associate to a method call with parameters | |
say_hi_to('Andy') { puts 'Hi!' } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment