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.



223
224
225
226
227
228
229
# File 'lib/json/pure/generator.rb', line 223

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