Skip to content

Instantly share code, notes, and snippets.

@shugo
Created August 3, 2012 04:18
Show Gist options
  • Save shugo/3244304 to your computer and use it in GitHub Desktop.
Save shugo/3244304 to your computer and use it in GitHub Desktop.
@_ko1 @nagachikaさんのコードをベースに試したら1.8と同じように動いているようです
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