Created
December 10, 2010 08:31
-
-
Save samnang/735965 to your computer and use it in GitHub Desktop.
Write your code here. Use binding method without using any variables or constants or define_singleton_method.
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
class A | |
@@a = 1 | |
@a = 2 | |
a = 3 | |
singleton_class.send(:define_method, :bindings) { binding } | |
end | |
p eval('[@@a, @a, a]', A.bindings) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment