Created
January 31, 2012 13:35
-
-
Save unnu/1710513 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 A | |
def self.hello | |
p 'hello' | |
end | |
def class | |
(class << self; self; end) | |
end | |
end | |
module Foo | |
def bar | |
p 'bar' | |
end | |
end | |
a = A.new | |
b = A.new | |
a.instance_eval do | |
class << self | |
extend Foo | |
end | |
end | |
a.class.hello | |
a.class.bar | |
b.class.hello | |
b.class.bar |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment