trace.inspect â string Instance Public methods Return a string containing a human-readable TracePoint status.
lineno() Instance Public methods Line number of the event
method_id() Instance Public methods Return the name of the method being called
path() Instance Public methods Path of the file being run
raised_exception() Instance Public methods Value from exception raised on the :raise event
return_value() Instance Public methods Return value from :return, c_return, and b_return event
self() Instance Public methods Return the trace object during event Same as #binding: trace.binding.eval('self')
add_filter(p = proc) Class Public methods Used to filter unwanted trace output Example which only outputs lines of code executed within the Kernel class: Tracer.add_filter do |event, file, line, id, binding, klass, *rest| "Kernel" == klass.to_s end
off() Class Public methods Disable tracing
on() Class Public methods Start tracing Example Tracer.on # code to trace here Tracer.off You can also pass a block: Tracer.on { # trace everything in this block }
Page 1811 of 11844