Created
October 16, 2012 06:57
-
-
Save worker8/3897641 to your computer and use it in GitHub Desktop.
how they work
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 proc_return | |
| Proc.new { return "proc1"}.call | |
| return "proc2 I AM HERE!" | |
| end | |
| def lambda_return | |
| lambda { return "lambda1" }.call | |
| return "lambda2 I AM HERE!" | |
| end | |
| def method_return | |
| method(:func).call | |
| return "method2 I AM HERE!" | |
| end | |
| def func | |
| return "method1" | |
| end | |
| puts proc_return | |
| puts lambda_return | |
| puts method_return | |
| #=== Result === | |
| proc1 | |
| lambda2 I AM HERE! | |
| method2 I AM HERE! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment