@@ -141,7 +141,7 @@ class MissingUnicodeSupport < JSONError; end
141141 # structures. Disable depth checking with :max_nesting => false. It
142142 # defaults to 100.
143143 # * *allow_nan*: If set to true, allow NaN, Infinity and -Infinity in
144- # defiance of RFC 4627 to be parsed by the Parser. This option defaults
144+ # defiance of RFC 7159 to be parsed by the Parser. This option defaults
145145 # to false.
146146 # * *symbolize_names*: If set to true, returns symbols for the names
147147 # (keys) in a JSON object. Otherwise strings are returned. Strings are
@@ -165,7 +165,7 @@ def parse(source, opts = {})
165165 # parse! methods defaults to not doing max depth checking: This can be
166166 # dangerous if someone wants to fill up your stack.
167167 # * *allow_nan*: If set to true, allow NaN, Infinity, and -Infinity in
168- # defiance of RFC 4627 to be parsed by the Parser. This option defaults
168+ # defiance of RFC 7159 to be parsed by the Parser. This option defaults
169169 # to true.
170170 # * *create_additions*: If set to false, the Parser doesn't create
171171 # additions even if a matching class and create_id was found. This option
@@ -402,27 +402,9 @@ def dump(obj, anIO = nil, limit = nil)
402402 raise ArgumentError , "exceed depth limit"
403403 end
404404
405- # Swap consecutive bytes of _string_ in place.
406- def self . swap! ( string ) # :nodoc:
407- 0 . upto ( string . size / 2 ) do |i |
408- break unless string [ 2 * i + 1 ]
409- string [ 2 * i ] , string [ 2 * i + 1 ] = string [ 2 * i + 1 ] , string [ 2 * i ]
410- end
411- string
412- end
413-
414- # Shortcut for iconv.
415- if ::String . method_defined? ( :encode )
416- # Encodes string using Ruby's _String.encode_
417- def self . iconv ( to , from , string )
418- string . encode ( to , from )
419- end
420- else
421- require 'iconv'
422- # Encodes string using _iconv_ library
423- def self . iconv ( to , from , string )
424- Iconv . conv ( to , from , string )
425- end
405+ # Encodes string using Ruby's _String.encode_
406+ def self . iconv ( to , from , string )
407+ string . encode ( to , from )
426408 end
427409
428410 if ::Object . method ( :const_defined? ) . arity == 1
0 commit comments