Skip to content

Instantly share code, notes, and snippets.

@jeffpeterson
Created May 30, 2013 22:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffpeterson/5681896 to your computer and use it in GitHub Desktop.
Save jeffpeterson/5681896 to your computer and use it in GitHub Desktop.
class Object
def method_lookup *args, result
public_methods(false).select do |name|
begin
begin
next clone.send(name, *args) == result
rescue TypeError
next send(name, *args) == result
end
send(name, *args) == result
rescue
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment