Method: JSON::Pure::Generator::State#to_h

Defined in:
lib/json/pure/generator.rb

#to_hObject

Returns the configuration instance variables as a hash, that can be passed to the configure method.



245
246
247
248
249
250
251
# File 'lib/json/pure/generator.rb', line 245

def to_h
  result = {}
  for iv in %w[indent space space_before object_nl array_nl allow_nan max_nesting ascii_only quirks_mode buffer_initial_length depth]
    result[iv.intern] = instance_variable_get("@#{iv}")
  end
  result
end