Created
August 3, 2012 04:18
-
-
Save shugo/3244304 to your computer and use it in GitHub Desktop.
@_ko1 @nagachikaさんのコードをベースに試したら1.8と同じように動いているようです
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
class Root | |
def foo | |
puts "Root#foo" | |
end | |
end | |
module M | |
def foo | |
super | |
puts "M#foo" | |
end | |
end | |
class A < Root | |
def foo | |
super | |
puts "A#foo" | |
end | |
end | |
class B<A | |
include M | |
def foo | |
super | |
puts "B#foo" | |
end | |
end | |
class A; include M ;end; | |
p B.ancestors | |
B.new.foo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment