Created
December 5, 2009 11:00
-
-
Save mynyml/249646 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
class Context | |
end | |
Context.new.instance_eval <<-END | |
class String | |
def foo() 'foo' end | |
end | |
puts ''.foo | |
END | |
#=> undefined method `foo' for "":String (NoMethodError) | |
----- | |
class Context | |
end | |
Context.new.instance_eval do | |
class String | |
def foo() 'foo' end | |
end | |
puts ''.foo | |
end | |
#=> foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment