Module: PSON::Pure::Generator::GeneratorMethods::Array

Defined in:
lib/octocatalog-diff/external/pson/pure/generator.rb

Instance Method Summary collapse

Instance Method Details

#to_pson(state = nil, depth = 0) ⇒ Object

Returns a PSON string containing a PSON array, that is unparsed from this Array instance. state is a PSON::State object, that can also be used to configure the produced PSON string output further. depth is used to find out nesting depth, to indent accordingly.



270
271
272
273
274
275
276
277
278
# File 'lib/octocatalog-diff/external/pson/pure/generator.rb', line 270

def to_pson(state = nil, depth = 0, *)
  if state
    state = PSON.state.from_state(state)
    state.check_max_nesting(depth)
    pson_check_circular(state) { pson_transform(state, depth) }
  else
    pson_transform(state, depth)
  end
end