213件ヒット
[201-213件を表示]
(0.062秒)
ライブラリ
- ビルトイン (213)
キーワード
- binding (12)
-
callee
_ id (12) -
defined
_ class (12) - disable (24)
- enable (24)
- enabled? (12)
-
eval
_ script (7) - event (12)
- inspect (12)
-
instruction
_ sequence (7) - lineno (12)
-
method
_ id (12) - parameters (7)
- path (12)
-
raised
_ exception (12) -
return
_ value (12) - self (12)
検索結果
-
TracePoint
# return _ value -> object (2.0) -
メソッドやブロックの戻り値を返します。
...timeError :return、:c_return、:b_return イベントのためのイベ
ントフックの外側で実行した場合に発生します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:return) do |tp|
p tp.return_value # => 1
end
trace.enable
foo 1
//}... -
TracePoint
# self -> object (2.0) -
イベントを発生させたオブジェクトを返します。
...イベントを発生させたオブジェクトを返します。
以下のようにする事で同じ値を取得できます。
//emlist[例][ruby]{
trace.binding.eval('self')
//}
@see TracePoint#binding......返します。
以下のようにする事で同じ値を取得できます。
なお、self メソッドは binding が nil になる :c_call および :c_return イベントに対しても正しく動作します。
//emlist[例][ruby]{
trace.binding.eval('self')
//}
@see TracePoint#binding...