source_location -> [String, Integer] | nilRuby 1.9.3 から[permalink][rdoc][edit]-
ソースコードのファイル名と行番号を配列で返します。
その手続オブジェクトが ruby で定義されていない(つまりネイティブである)場合は nil を返します。
例# /path/to/target.rb を実行 proc {}.source_location # => ["/path/to/target.rb", 1] proc {}.source_location # => ["/path/to/target.rb", 2] p (eval "proc {}").source_location # => ["(eval)", 1] p method(:p).to_proc.source_location # => nil[SEE_ALSO] Method#source_location