鉴于任何物体,我可打电话到<代码>#public_methods,并查阅其将采用的所有方法。 然而,我有时认为,迅速列出所有尚未继承的公共方法,即真正属于这一类别的一部分的 st脚。
(Foo.public_methods - Object.public_methods).sort
I can filter out a lot of basic Ruby stuff. I d like to be able to filter everything that was inherited all the way up the chain. If I know the parent class I can filter using it, but I d like to come up with a generic command that could return an array of the uninherited public methods for any object.