在写ruby代码或者rails项目的时候,借助于IDE我们能很快的找到方法定义的位置,但在使用的元编程等情况下找起来就比较麻烦了,此时可以使用source_location方法
该方法返回定义方法的源文件和行号
obj.method(:method_name).source_location
source_location → [String, Fixnum]
Returns the Ruby source filename and line number
containing this method or nil if this method was not defined in Ruby (i.e. native)