在Ruby的类层次结构中,您如何列出已包含在特定类中的模块?像这样:moduleSomeModuleendclassParentModel[SomeModule]pChildModel.included_modules(false)#=>[]列出祖先使模块在树中显得更高:pChildModel.ancestors#=>[ChildModel,ParentModel,SomeModule,Object,Kernel] 最佳答案 据我了解你的问题,你正在寻找这样的东西:classClassdefmixin_ancestors(inclu