summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Lundberg <per.lundberg@ecraft.com>2017-05-31 13:42:43 +0300
committerGitHub <noreply@github.com>2017-05-31 13:42:43 +0300
commit4c3fa82f905c2b01cc9186c0b701c0f1b1956a11 (patch)
tree41cf7af60bf1d1962b33f81778ce2e1d135c04b9
parent4688035c424a26a8d943c261170988f1b788fa56 (diff)
downloadjson-4c3fa82f905c2b01cc9186c0b701c0f1b1956a11.tar.gz
Fixed json_create example to use create_additions = true
The example doesn't work OOTB, since this flag is _not enabled_ by default. (Even with this change in place, I cannot get additions to work with the `Range` class. For custom objects it works though, I tested with the example from the `json_addition_test.rb` - that's where I got the working approach.)
-rw-r--r--README.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/README.md b/README.md
index f9cd95d..7d5b156 100644
--- a/README.md
+++ b/README.md
@@ -212,7 +212,7 @@ Now it possible to serialise/deserialise ranges as well:
```ruby
json = JSON.generate [1, 2, {"a"=>3.141}, false, true, nil, 4..10]
# => "[1,2,{\"a\":3.141},false,true,null,{\"json_class\":\"Range\",\"data\":[4,10,false]}]"
- JSON.parse json
+ JSON.parse json, :create_additions => true
# => [1, 2, {"a"=>3.141}, false, true, nil, 4..10]
```