Skip to content

Instantly share code, notes, and snippets.

@thorncp
Created February 16, 2010 18:12
Show Gist options
  • Select an option

  • Save thorncp/305753 to your computer and use it in GitHub Desktop.

Select an option

Save thorncp/305753 to your computer and use it in GitHub Desktop.
def find_method(obj, method)
obj.class.ancestors.each do |a|
return a if a.public_instance_methods(false).map(&:to_s).include?(method.to_s)
end
nil
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment