3
我想要做这样的事情:包括一个混合内混入
module Mixin
def self.included(base)
base.include AnotherMixin
...
end
end
这给错误
NoMethodError - private method `include' called for Class
我如何可以包括一个mixin一个mixin在里面使用我正在定义的方法?
只是删除从'base.include AnotherMixin'了'base' ...它将工作。 –
@ArupRakshit - 它将包含AnotherMixin withn Mixin - 尝试使用'included_modules'检查它 – BroiSatse
@BroiSatse *如何在mixin中包含mixin *意味着什么? –