@@ -7,8 +7,7 @@ class << self
7
7
# :call-seq:
8
8
# JSON[object] -> new_array or new_string
9
9
#
10
- # If +object+ is a
11
- # {String-convertible object}[doc/implicit_conversion_rdoc.html#label-String-Convertible+Objects],
10
+ # If +object+ is a \String,
12
11
# calls JSON.parse with +object+ and +opts+ (see method #parse):
13
12
# json = '[0, 1, null]'
14
13
# JSON[json]# => [0, 1, nil]
@@ -149,12 +148,9 @@ class MissingUnicodeSupport < JSONError; end
149
148
#
150
149
# Returns the Ruby objects created by parsing the given +source+.
151
150
#
152
- # Argument +source+ contains the \String to be parsed. It must be a
153
- # {String-convertible object}[doc/implicit_conversion_rdoc.html#label-String-Convertible+Objects]
154
- # (implementing +to_str+), and must contain valid \JSON data.
151
+ # Argument +source+ contains the \String to be parsed.
155
152
#
156
- # Argument +opts+, if given, contains options for the parsing, and must be a
157
- # {Hash-convertible object}[doc/implicit_conversion_rdoc.html#label-Hash+Convertible+Objects].
153
+ # Argument +opts+, if given, contains a \Hash of options for the parsing.
158
154
# See {Parsing Options}[#module-JSON-label-Parsing+Options].
159
155
#
160
156
# ---
@@ -249,22 +245,17 @@ def load_file!(filespec, opts = {})
249
245
#
250
246
# Argument +obj+ is the Ruby object to be converted to \JSON.
251
247
#
252
- # Argument +opts+, if given, contains options for the generation, and must be a
253
- # {Hash-convertible object}[doc/implicit_conversion_rdoc.html#label-Hash-Convertible+Objects].
248
+ # Argument +opts+, if given, contains a \Hash of options for the generation.
254
249
# See {Generating Options}[#module-JSON-label-Generating+Options].
255
250
#
256
251
# ---
257
252
#
258
- # When +obj+ is an
259
- # {Array-convertible object}[doc/implicit_conversion_rdoc.html#label-Array-Convertible+Objects]
260
- # (implementing +to_ary+), returns a \String containing a \JSON array:
253
+ # When +obj+ is an \Array, returns a \String containing a \JSON array:
261
254
# obj = ["foo", 1.0, true, false, nil]
262
255
# json = JSON.generate(obj)
263
256
# json # => '["foo",1.0,true,false,null]'
264
257
#
265
- # When +obj+ is a
266
- # {Hash-convertible object}[doc/implicit_conversion_rdoc.html#label-Hash-Convertible+Objects],
267
- # return a \String containing a \JSON object:
258
+ # When +obj+ is a \Hash, returns a \String containing a \JSON object:
268
259
# obj = {foo: 0, bar: 's', baz: :bat}
269
260
# json = JSON.generate(obj)
270
261
# json # => '{"foo":0,"bar":"s","baz":"bat"}'
@@ -436,8 +427,7 @@ class << self
436
427
# BEWARE: This method is meant to serialise data from trusted user input,
437
428
# like from your own database server or clients under your control, it could
438
429
# be dangerous to allow untrusted users to pass JSON sources into it.
439
- # - Argument +opts+, if given, contains options for the parsing, and must be a
440
- # {Hash-convertible object}[doc/implicit_conversion_rdoc.html#label-Hash+Convertible+Objects].
430
+ # - Argument +opts+, if given, contains a \Hash of options for the parsing.
441
431
# See {Parsing Options}[#module-JSON-label-Parsing+Options].
442
432
# The default options can be changed via method JSON.load_default_options=.
443
433
#
0 commit comments