Skip to content

Instantly share code, notes, and snippets.

@apostergiou
Created March 25, 2017 19:10
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 apostergiou/486295f48cfb3a4bd416cf467e81343e to your computer and use it in GitHub Desktop.
Save apostergiou/486295f48cfb3a4bd416cf467e81343e to your computer and use it in GitHub Desktop.
Debugging ruby

Find out method definition

foo = Object.new
p foo.method(:bar).source_location

Bundle open

$ bundle open whenever

$ gem pristine whenever # restore gem

Super calling

def foo
  puts method(:foo).super_method.source_location
  super
end

List all methods on an object

foo.methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment