Skip to content

Instantly share code, notes, and snippets.

@kbaribeau
Created August 24, 2011 00:32
Show Gist options
  • Save kbaribeau/1167005 to your computer and use it in GitHub Desktop.
Save kbaribeau/1167005 to your computer and use it in GitHub Desktop.
class Foo
Object = nil
def getBinding()
binding()
end
end
Foo::Object #returns nil
Object #returns Object
eval("Object", Foo.new.getBinding()) #returns nil
eval("::Object", Foo.new.getBinding()) #returns Object
class Foo
::Object = nil # warning: already initialized constant Object
end
Object #returns nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment