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