diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2020-01-30 12:48:05 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2020-09-25 17:28:42 +0900 |
commit | e1659af3724e2320e9f2f2bd7cf602686e8aa523 (patch) | |
tree | d97e3f3fef7109a3ebea4e8c39352fe89a0c6cd0 /ext/json/lib/json | |
parent | c5ea060ef8cd6c0de9987d1a3546b79e99ebb35c (diff) |
Add an option to escape forward slash character
Squashed commit of the following:
commit 26d181059989279a79c433cedcd893b4f52e42ee
Author: Francois Chagnon <francois.chagnon@jadedpixel.com>
Date: Tue Sep 15 21:17:34 2015 +0000
add config options for escape_slash
commit fa282334051b16df91ca097dd7304b46f3bc7719
Author: Francois Chagnon <francois.chagnon@jadedpixel.com>
Date: Mon Feb 9 21:09:33 2015 +0000
add forward slash to escape character
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3581
Diffstat (limited to 'ext/json/lib/json')
-rw-r--r-- | ext/json/lib/json/common.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/json/lib/json/common.rb b/ext/json/lib/json/common.rb index 991d7604fd..8e45b511fc 100644 --- a/ext/json/lib/json/common.rb +++ b/ext/json/lib/json/common.rb @@ -593,12 +593,13 @@ module JSON # Sets or returns the default options for the JSON.dump method. # Initially: # opts = JSON.dump_default_options - # opts # => {:max_nesting=>false, :allow_nan=>true} + # opts # => {:max_nesting=>false, :allow_nan=>true, :escape_slash=>false} attr_accessor :dump_default_options end self.dump_default_options = { :max_nesting => false, :allow_nan => true, + :escape_slash => false, } # Dumps _obj_ as a JSON string, i.e. calls generate on the object and returns |