-
-
Save trshafer/1169678 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 One | |
def go | |
1 | |
end | |
end | |
module Two | |
def go | |
2 | |
end | |
end | |
obj = Module.new | |
obj.extend One | |
obj.extend Two | |
call = 0 | |
puts "call #{call+=1}: #{obj.go}" | |
obj.extend One.clone | |
puts "call #{call+=1}: #{obj.go}" | |
obj.extend Two.clone | |
puts "call #{call+=1}: #{obj.go}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment