Skip to content

Instantly share code, notes, and snippets.

@miaout17
Created August 19, 2011 15:02
Show Gist options
  • Save miaout17/1156994 to your computer and use it in GitHub Desktop.
Save miaout17/1156994 to your computer and use it in GitHub Desktop.
class A; end
class B; end
A.class_eval { Y=3 }
B.class_eval " Z=3 "
puts Object.const_defined? :Y #true
puts A.const_defined? :Y #false
puts Object.const_defined? :Z #false
puts B.const_defined? :Z #true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment