class TracePoint < Object def initialize: (*Symbol events) { (TracePoint tp) -> void } -> void # Returns internal information of # [TracePoint](TracePoint.downloaded.ruby_doc). # # The contents of the returned value are implementation specific. It may # be changed in future. # # This method is only for debugging # [TracePoint](TracePoint.downloaded.ruby_doc) itself. def self.stat: () -> untyped def self.trace: (*Symbol events) { (TracePoint tp) -> void } -> TracePoint # Return the generated binding object from event def binding: () -> Binding # Return the called name of the method being called def callee_id: () -> Symbol def `defined_class`: () -> Module # Deactivates the trace # # Return true if trace was enabled. Return false if trace was disabled. # # ```ruby # trace.enabled? #=> true # trace.disable #=> true (previous status) # trace.enabled? #=> false # trace.disable #=> false # ``` # # If a block is given, the trace will only be disable within the scope of # the block. # # ```ruby # trace.enabled? # #=> true # # trace.disable do # trace.enabled? # # only disabled for this block # end # # trace.enabled? # #=> true # ``` # # Note: You cannot access event hooks within the block. # # ```ruby # trace.disable { p tp.lineno } # #=> RuntimeError: access from outside # ``` def disable: () -> bool | () { () -> void } -> void def enable: () -> bool | () { () -> void } -> void # The current status of the trace def enabled?: () -> bool def inspect: () -> String # Line number of the event def lineno: () -> Integer # Return the name at the definition of the method being called def method_id: () -> Symbol # Path of the file being run def path: () -> String # Value from exception raised on the `:raise` event def raised_exception: () -> untyped # Return value from `:return`, `c_return`, and `b_return` event def return_value: () -> untyped # Return the trace object during event # # Same as [\#binding](TracePoint.downloaded.ruby_doc#method-i-binding): # # ```ruby # trace.binding.eval('self') # ``` def `self`: () -> Binding end