Rails

How To Find Out Where A Method Is Defined In Ruby

Posted by Weston Ganger on June 09, 2016

Sometimes you may have an error in a method somewhere and you want to find out where it is defined. Here are two extremely helpful methods for finding out this information. Note these methods require Ruby 1.9+


"55".method(:to_i).source_location
"55".method(:to_i).owner


Related External Links:


Posted in Rails and Tagged with ruby debug 


Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts