22件ヒット
[1-22件を表示]
(0.111秒)
ライブラリ
- ビルトイン (22)
キーワード
- binding (11)
-
source
_ location (11)
検索結果
-
Proc
# binding -> Binding (20408.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 (14114.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...