Created
May 19, 2009 09:44
-
-
Save severin/114014 to your computer and use it in GitHub Desktop.
List of real (defined here) instance methods
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
def real_instance_methods_of(klass) | |
klass.instance_methods - ((klass.ancestors - [klass]).map(&:instance_methods).flatten) | |
end | |
class Class | |
def instance_methods_defined_here | |
real_instance_methods_of self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment