我有两个具有相同方法名称的模块。当我在某个类中包含两个模块时,只执行最后一个模块的方法。相反,我需要在初始化类时执行两者:
class MyClass
include FirstModule
include SecondModule
def initialize
foo # foo is contained in both modules but only the one in SecondModules is executed
end
end
可行吗?