Skip to content

Instantly share code, notes, and snippets.

@kuruma-gs
Created November 25, 2011 01:18
Show Gist options
  • Save kuruma-gs/1392603 to your computer and use it in GitHub Desktop.
Save kuruma-gs/1392603 to your computer and use it in GitHub Desktop.
強度確認
class A
def a
"super"
end
end
module B
def a
"module"
end
end
module B2
def a
"module2"
end
end
class C < A
def a
"direct"
end
include B
end
C.new.a #=> "direct"
class D < A
include B
end
D.new.a #=> "module"
class E < A
include B
include B2
end
E.new.a #=> "module2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment