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 


Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts