Module: BinData::TraceHook

Included in:
BasePrimitive, Choice
Defined in:
lib/bindata/trace.rb

Instance Method Summary collapse

Instance Method Details

#turn_off_tracingObject



55
56
57
58
59
60
# File 'lib/bindata/trace.rb', line 55

def turn_off_tracing
  if method_defined? :do_read_without_hook
    alias_method :do_read, :do_read_without_hook
    remove_method :do_read_without_hook
  end
end

#turn_on_tracingObject



48
49
50
51
52
53
# File 'lib/bindata/trace.rb', line 48

def turn_on_tracing
  if !method_defined? :do_read_without_hook
    alias_method :do_read_without_hook, :do_read
    alias_method :do_read, :do_read_with_hook
  end
end