るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. matrix i

ライブラリ

キーワード

検索結果

Proc#binding -> Binding (12407.0)

Proc オブジェクトが保持するコンテキストを Binding オブジェクトで返します。

...
Proc
オブジェクトが保持するコンテキストを
Binding オブジェクトで返します。

//emlist[例][ruby]{
def fred(param)
proc
{}
end

sample_proc = fred(99)
eval
("param", sample_proc.binding) # => 99
//}...

Proc#source_location -> [String, Integer] | nil (6113.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...