るりまサーチ

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

別のキーワード

  1. rss source
  2. _builtin source_location
  3. socket ip_block_source
  4. _builtin source_encoding
  5. socket ip_unblock_source

ライブラリ

検索結果

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

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

...by]{
# /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...