这是怎么回事:
module Sounds
def dog
"bark"
end
end
module Noises
def dog
"woof"
end
end
class Animals
include Sounds
include Noises
end
x = Animals.new
x.dog # Returns "woof", as I expected
class Animals
include Sounds
end
x.dog # Still returns "woof" for some reason -- shouldn't it be bark?
y = Animals.new
y.dog # Also returns "woof" for some reason -- shouldn't it be bark?