Created
August 1, 2012 12:52
-
-
Save stevenbristol/3226615 to your computer and use it in GitHub Desktop.
instance_eval and class_eval 2
This file contains 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
"string2".instance_eval { p self } # => "string2" | |
begin | |
"string2".class_eval { p self } | |
rescue Exception => e | |
p e # => #<NoMethodError: undefined method `class_eval' for "string2":String> | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment