るりまサーチ (Ruby 2.1.0)

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

別のキーワード

  1. _builtin to_proc
  2. _builtin proc
  3. proc curry
  4. readline completion_proc
  5. httpserver mount_proc

ライブラリ

検索結果

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

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

...mlist[例][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#sour...