Skip to content

Instantly share code, notes, and snippets.

@severin
Created May 19, 2009 09:44
Show Gist options
  • Save severin/114014 to your computer and use it in GitHub Desktop.
Save severin/114014 to your computer and use it in GitHub Desktop.
List of real (defined here) instance methods
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