11件ヒット
[1-11件を表示]
(0.138秒)
検索結果
先頭1件
-
TracePoint (46063.0)
-
Kernel.#set_trace_func と同様の機能をオブジェクト指向的な API で 提供するクラスです。
...集する][ruby]{
trace = TracePoint.new(:raise) do |tp|
p [tp.lineno, tp.event, tp.raised_exception]
end
# => #<TracePoint:0x007f786a452448>
trace.enable
# => false
0 / 0
# => [5, :raise, #<ZeroDivisionError: divided by 0>]
//}
TracePoint.new または、TracePoint.trace で指定したブロ......トの詳細については、TracePoint.new を参照してくださ
い。
=== 参考
* Ruby VM アドベントカレンダー #12 TracePoint の紹介 (1): https://www.atdot.net/~ko1/diary/201212.html#d12
* Ruby VM アドベントカレンダー #13 TracePoint の紹介 (2): https://www.atdot.......net/~ko1/diary/201212.html#d13
* Ruby VM アドベントカレンダー #14 TracePoint の紹介 (3): https://www.atdot.net/~ko1/diary/201212.html#d14...