假设我有一个名为Stream的基类和一堆Stream的子类。
class Stream
include DateTimeHelper
include LinkHelper
include FormatHelper
def ...
...
end
end
class LongStream < Stream
def ...
...
end
end
因此,这里的子类可以访问包含模块中的任何方法。
根据重构历史,有一种机会,例如,层次结构中的所有类都不使用FormatHelper中的任何方法。有没有办法让我以编程方式检查是否正在使用任何模块的方法?