Skip to content

Instantly share code, notes, and snippets.

@vadviktor
Created July 5, 2025 17:26
Show Gist options
  • Save vadviktor/5097d2165ffb8e052718b8a8f2d04ab3 to your computer and use it in GitHub Desktop.
Save vadviktor/5097d2165ffb8e052718b8a8f2d04ab3 to your computer and use it in GitHub Desktop.
Finding where a method is defined in Ruby using IRB

There are three ways to find out where a method is defined in Ruby using IRB:

  • using the source_location defined on the Method object
  • using the IRB show_source command
  • displaying information about an object using ls (for displaying the object but not the source file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment