Created
June 10, 2010 18:52
-
-
Save judofyr/433451 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
# mod.const_get(const) is not always the same as mod::const | |
# Anyone knows why? | |
A = 1 | |
class Foo | |
end | |
module Bar | |
end | |
p Foo.const_get(:A) | |
p Bar.const_get(:A) | |
p Foo::A # works, but with a warning | |
p Bar::A # raises error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment