summaryrefslogtreecommitdiff
path: root/lib/json/common.rb
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2020-01-30 12:48:05 +0100
committerJean Boussier <jean.boussier@gmail.com>2020-07-04 12:14:47 +0200
commit8a18cf6a14fc1fae54b3d581434a255c9d98ceea (patch)
tree059a4f393a91df8506b4212e5158282fe1b07402 /lib/json/common.rb
parent617428650d48db8a4b5439968e441f859605c6f3 (diff)
downloadjson-8a18cf6a14fc1fae54b3d581434a255c9d98ceea.tar.gz
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
Diffstat (limited to 'lib/json/common.rb')
-rw-r--r--lib/json/common.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/json/common.rb b/lib/json/common.rb
index 132e9c8..ed4e047 100644
--- a/lib/json/common.rb
+++ b/lib/json/common.rb
@@ -436,12 +436,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