If a class includes many modules, and the methods gained from the include call private methods from their originating modules, and private methods exist in other modules with the same name, it should use the definition from its own module. In code:
module C
def c
puts collision
end
private
def collision
'c'
end
end
module B
def b
puts collision
end
private
def collision
'b'
end
end
class A
include B
include C
end
A.new.b
# => 'c'
I expected A.new.b to give 'b' and A.new.c to give 'c' but there is collision because they use the same private method name. In large projects with many includes, how is this avoided?