You know what method is being and you want to figure out how it got there. Raising an exception is a bit harsh since all you want is a stack trace
puts caller
Seriously. It's that easy. If you're getting too much information you could
puts caller[0..2]
Since caller is just an array of strings.
Amazing. So simple, so hard to find out how to do this by googling!
This is saving my hair follicles (what's left of them) as I am using rubymotion for IOS which sadly lacks an effective debugger.
I've been putting logging all over the place to find out where things are being called repeatedly; all I needed to do was
(mp is short for motion-print which is better than puts in rubymotion).
And of course in plain ruby, I would just use byebug and get the full debugging experience.