def truncate(object, seen = Set.new)
      if seen.include?(object.object_id)
        return CIRCULAR if CIRCULAR_TYPES.any? { |t| object.is_a?(t) }
        return object
      end
      truncate_object(object, seen << object.object_id)
    end
def truncate(object, seen = Set.new)
      if seen.include?(object.object_id)
        return CIRCULAR if CIRCULAR_TYPES.any? { |t| object.is_a?(t) }
        return object
      end
      truncate_object(object, seen << object.object_id)
    end
@param [Integer] max_size maximum size of hashes, arrays and strings
 Performs deep truncation of arrays, hashes, sets & strings. Uses a
 placeholder for recursive objects (`[Circular]`).

 @param [Object] object The object to truncate
 @param [Set] seen The cache that helps to detect recursion
 @return [Object] truncated object