165: def configure(opts)
166: @indent = opts[:indent] if opts.key?(:indent)
167: @space = opts[:space] if opts.key?(:space)
168: @space_before = opts[:space_before] if opts.key?(:space_before)
169: @object_nl = opts[:object_nl] if opts.key?(:object_nl)
170: @array_nl = opts[:array_nl] if opts.key?(:array_nl)
171: @check_circular = !!opts[:check_circular] if opts.key?(:check_circular)
172: @allow_nan = !!opts[:allow_nan] if opts.key?(:allow_nan)
173: if !opts.key?(:max_nesting)
174: @max_nesting = 19
175: elsif opts[:max_nesting]
176: @max_nesting = opts[:max_nesting]
177: else
178: @max_nesting = 0
179: end
180: self
181: end