Created
January 17, 2012 15:16
-
-
Save jasiek/1627013 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 M | |
def hello | |
1 | |
end | |
end | |
module N | |
include M | |
def hello | |
2 + super | |
end | |
end | |
class C | |
include N | |
end | |
puts C.new.hello # 3 | |
class C | |
def hello | |
7 + M.instance_method(:hello).bind(self).call | |
end | |
end | |
puts C.new.hello # 8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment