Created
September 29, 2010 22:16
-
-
Save p8/603673 to your computer and use it in GitHub Desktop.
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
String.class_eval { def instance_method; "instance method"; end } | |
String.class.class_eval { def class_method; "class method"; end } | |
String.class.class.class_eval { def eigenclass_method; "eigenclass method"; end } | |
"a".instance_method # => "instance method" | |
String.class_method # => "class method" | |
class X < String | |
eigenclass_method | |
end # => "eigenclass method" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment