Last active
August 29, 2015 14:15
-
-
Save lin/1454170664b6ba384303 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 hello str, &block | |
| pre_str = str + " world!" | |
| block.call pre_str | |
| after_str = "say " + str | |
| puts after_str | |
| end | |
| hello "hello" do |str| | |
| puts "MC says #{str}" | |
| end | |
| hello "hello" do |str| | |
| puts "YL says #{str}" | |
| end | |
| ##### outputs | |
| # MC says hello world! | |
| # say hello | |
| # YL says hello world! | |
| # say hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment