Finding out what called a Ruby method using the Kernel method caller | Debugging | Debugger

Опубликовано: 17 Февраль 2026
на канале: Tosbourn
30
2

Companion blog post https://tosbourn.com/ruby-what-called...

Sometimes when we’re debugging some Ruby code, it is good to know what code has called the method we’re looking at. It is something I routinely like to know.

There are a few different ways we can go about this, but the one I reach for more often than not is the Ruby kernel method caller.

This video talks through what `caller` does with a short example, and shows a few different ways I've used it to get what I need.

00:00 Intro
00:14 What caller does
01:04 Using caller in an example
03:17 Going through a call stack
04:53 Passing an index into caller
05:57 Passing a range into caller
06:50 Recap

-----

We help people with their web projects, from making websites and web apps, to helping with strategy and roadmap planning.

You can learn more about us on our website and LinkedIn;

https://tosbourn.com
  / 19658308  

#Ruby #RubyOnRails #WebDevelopment #Debugger #Debugging #DebuggingTips