summaryrefslogtreecommitdiff
path: root/lib/json/common.rb
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-28 09:22:57 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-11-28 09:22:57 +0000
commit0cf0b824182fc643c4e295b7178b84e71fdded54 (patch)
treef8eb0bb1ca3effb41119a9e505395f6ba8003752 /lib/json/common.rb
parent6272cf8ecd8f4cd35af10aecf505f22b8244c56d (diff)
* ext/json, lib/json, test/json: Update to JSON 1.1.2.
(RubyForge#15447) * math.c: fix typo. -- M ChangeLog M math.c M ext/json/ext/generator/generator.c M ext/json/ext/parser/parser.rl M ext/json/ext/parser/parser.c M lib/json/version.rb M lib/json/editor.rb M lib/json/common.rb M lib/json/pure/parser.rb M test/json/test_json_unicode.rb M test/json/test_json_fixtures.rb M test/json/test_json_generate.rb M test/json/test_json_addition.rb M test/json/test_json.rb M test/json/runner.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/json/common.rb')
-rw-r--r--lib/json/common.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/json/common.rb b/lib/json/common.rb
index c988677a1d..7bc5ae0656 100644
--- a/lib/json/common.rb
+++ b/lib/json/common.rb
@@ -115,6 +115,9 @@ module JSON
# * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
# defiance of RFC 4627 to be parsed by the Parser. This option defaults
# to false.
+ # * *create_additions*: If set to false, the Parser doesn't create
+ # additions even if a matchin class and create_id was found. This option
+ # defaults to true.
def parse(source, opts = {})
JSON.parser.new(source, opts).parse
end
@@ -131,6 +134,9 @@ module JSON
# * *allow_nan*: If set to true, allow NaN, Infinity, and -Infinity in
# defiance of RFC 4627 to be parsed by the Parser. This option defaults
# to true.
+ # * *create_additions*: If set to false, the Parser doesn't create
+ # additions even if a matchin class and create_id was found. This option
+ # defaults to true.
def parse!(source, opts = {})
opts = {
:max_nesting => false,
@@ -161,6 +167,9 @@ module JSON
# * *allow_nan*: true if NaN, Infinity, and -Infinity should be
# generated, otherwise an exception is thrown, if these values are
# encountered. This options defaults to false.
+ # * *max_nesting*: The maximum depth of nesting allowed in the data
+ # structures from which JSON is to be generated. Disable depth checking
+ # with :max_nesting => false, it defaults to 19.
#
# See also the fast_generate for the fastest creation method with the least
# amount of sanity checks, and the pretty_generate method for some