Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
JSON#parse!
(::string source, ?::JSON::options opts) -> untyped
JSON.parse!(source, opts) → object
ext/json/lib/json/common.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.4.1/ext/json/lib/json/common.rb, line 235
def parse!(source, opts = {})
opts = {
:max_nesting => false,
:allow_nan => true
}.merge(opts)
Parser.new(source, **(opts||{})).parse
end
Calls
Example
parse(source, opts)
with source and possibly modified opts.
Differences from JSON.parse:
-
Option
max_nesting, if not provided, defaults tofalse, which disables checking for nesting depth. -
Option
allow_nan, if not provided, defaults totrue.
See also
#parse
#pretty_generate
#merge_dump_options
#restore
also in
4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0