TracePoint.new(*events) { |obj| block } â obj
Class Public methods
Returns a new TracePoint object, not enabled
by default.
Next, in order to activate the trace, you must use #enable
trace = TracePoint.new(:call) do |tp|
p [tp.lineno, tp.defined_class, tp.method_id, tp.event]
end
#=> #<TracePoint:0x007f17372cdb20>
trace.enable
#=> #<TracePoint:0x007f17372cdb20>
puts "Hello, TracePoint!"
# ...
# [48, IRB::Notifier::AbstractNotifier, :printf, :call]