Created
March 25, 2013 21:33
-
-
Save robertjwhitney/5240994 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
# Return a list of methods defined locally for a particular object. Useful | |
# for seeing what it does whilst losing all the guff that's implemented | |
# by its parents (eg Object). | |
def local_methods(obj = self) | |
(obj.methods - obj.class.superclass.instance_methods).sort | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment