Skip to content

Instantly share code, notes, and snippets.

@judofyr
Created June 10, 2010 18:52
Show Gist options
  • Save judofyr/433451 to your computer and use it in GitHub Desktop.
Save judofyr/433451 to your computer and use it in GitHub Desktop.
# 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