KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Given any object I can call #public_methods and see all the methods it will respond to. However, I find it would sometimes be handy to get a quick list of all the public methods that are not inherited, i.e. the stuff that's really part of this class. I found in " Easy way to list public methods for a Ruby object " that if I use: (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.
Tags (comma-separated)
Save Edits
Cancel