Created
May 1, 2009 23:18
-
-
Save carllerche/105316 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
module Awesome | |
def baz | |
puts "baz" | |
end | |
end | |
class Foo | |
end | |
backup_foo = Foo.clone | |
class Foo | |
include Awesome | |
end | |
foo_obj = Foo.new | |
foo_obj.baz # => baz | |
Object.send :remove_const, :Foo | |
Foo = backup_foo | |
foo_obj.baz # => baz | |
Foo.new.baz # NoMethodError: undefined method ‘baz’ for #<Foo:0x1d650> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment