Method: JSON::Pure::Generator::State#check_max_nesting

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

#check_max_nestingObject

:nodoc:



190
191
192
193
194
195
# File 'lib/json/pure/generator.rb', line 190

def check_max_nesting # :nodoc:
  return if @max_nesting.zero?
  current_nesting = depth + 1
  current_nesting > @max_nesting and
    raise NestingError, "nesting of #{current_nesting} is too deep"
end