るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.146秒)
トップページ > クエリ:i[x] > クエリ:A[x] > クエリ:target[x] > クエリ:source_location[x]

別のキーワード

  1. resource target
  2. srv target
  3. instruction target
  4. instruction target=
  5. resolv target

ライブラリ

クラス

検索結果

Proc#source_location -> [String, Integer] | nil (30349.0)

ソースコードのファイル名と行番号を配列で返します。

...nil を返します。


//emlist[例][ruby]{
# /path/to/target.rb を実行
proc {}.source_location # => ["/path/to/target.rb", 1]
proc {}.source_location # => ["/path/to/target.rb", 2]
(eval "proc {}").source_location # => ["(eval)", 1]
method(:p).to_proc.source_location #...
...=> nil
//}

@see Method#source_location...