22件ヒット
[1-22件を表示]
(0.105秒)
種類
- インスタンスメソッド (11)
- 特異メソッド (11)
クラス
- TracePoint (22)
検索結果
-
TracePoint
# event -> Symbol (29115.0) -
発生したイベントの種類を Symbol で返します。
...詳細については、TracePoint.new を参照してくださ
い。
@raise RuntimeError イベントフックの外側で実行した場合に発生します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call, :return) do |tp|
p tp.event
end
trace.enable
foo 1
# => :c... -
TracePoint
. new(*events) {|obj| . . . } -> TracePoint (11238.0) -
新しい TracePoint オブジェクトを作成して返します。トレースを有効 にするには TracePoint#enable を実行してください。
...TracePoint オブジェクトを作成して返します。トレースを有効
にするには TracePoint#enable を実行してください。
//emlist[例:irb で実行した場合][ruby]{
trace = TracePoint.new(:call) do |tp|
p [tp.lineno, tp.defined_class, tp.method_id, tp.event]
end
# =......<TracePoint:0x007f17372cdb20>
trace.enable
# => false
puts "Hello, TracePoint!"
# ...
# [69, IRB::Notifier::AbstractNotifier, :printf, :call]
# ...
//}
トレースを無効にするには TracePoint#disable を実行してください。
//emlist[][ruby]{
trace.disable
//}
@param events トレ......ースするイベントを String か Symbol で任
意の数指定します。
: :line
式の評価。
: :class
クラス定義、特異クラス定義、モジュール定義への突入。
: :end
クラス定義、特異クラス定義、モジュール定義の終了...