instance method Binding#source_location

source_location -> [String, Integer][permalink][rdoc][edit]

self の Ruby のソースファイル名と行番号を返します。

変数と定数/擬似変数 の __FILE__ と __LINE__ も参照してください。



p binding.source_location # => ["test.rb", 1]