Module: Ibex::Runtime::JSONLTracer

Defined in:
lib/ibex/runtime/jsonl_tracer.rb,
sig/ibex/runtime/jsonl_tracer.rbs

Overview

Emits committed parser observer events as JSON Lines.

Defined Under Namespace

Modules: Hooks, _TraceOutput

Class Method Summary collapse

Class Method Details

.attach(parser, io:) ⇒ void

This method returns an undefined value.

RBS:

  • [P < Parser] (P parser, io: _TraceOutput) -> P



66
67
68
69
70
71
72
# File 'lib/ibex/runtime/jsonl_tracer.rb', line 66

def self.attach(parser, io:)
  singleton = parser.singleton_class
  singleton.prepend(Hooks) unless singleton.ancestors.include?(Hooks)
  Object.instance_method(:instance_variable_set).bind_call(parser, :@runtime_fast_path, false)
  parser.__send__(:ibex_jsonl_trace_output=, io)
  parser
end