るりまサーチ

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

別のキーワード

  1. string []=
  2. string slice
  3. string slice!
  4. string []
  5. string gsub!

ライブラリ

検索結果

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

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

... ruby で定義されていない(つまりネイティブ
である)場合は 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...