Created
October 16, 2012 07:02
-
-
Save worker8/3897650 to your computer and use it in GitHub Desktop.
what-class
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 what_class(&code) | |
| return code.class | |
| end | |
| def func | |
| "nothing" | |
| end | |
| puts (what_class do end) | |
| puts Proc.new {}.class | |
| puts lambda{}.class | |
| puts method(:func).class | |
| #=== Result === | |
| Proc | |
| Proc | |
| Proc | |
| Method |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment