Module: Ibex::Runtime::JSONLTracer

Defined in:
lib/ibex/runtime/jsonl_tracer.rb

Overview

Emits committed parser observer events as JSON Lines.

Defined Under Namespace

Modules: Hooks

Class Method Summary collapse

Class Method Details

.attach(parser, io:) ⇒ Object



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