guard_inspect_key()
public
Yields to a block and preserves the previous set of objects being printed.
Show source
def guard_inspect_key
if Thread.current[:__recursive_key__] == nil
Thread.current[:__recursive_key__] = {}.taint
end
if Thread.current[:__recursive_key__][:inspect] == nil
Thread.current[:__recursive_key__][:inspect] = {}.taint
end
save = Thread.current[:__recursive_key__][:inspect]
begin
Thread.current[:__recursive_key__][:inspect] = {}.taint
yield
ensure
Thread.current[:__recursive_key__][:inspect] = save
end
end