diff options
author | Per Lundberg <per.lundberg@ecraft.com> | 2017-05-31 13:42:43 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-31 13:42:43 +0300 |
commit | 4c3fa82f905c2b01cc9186c0b701c0f1b1956a11 (patch) | |
tree | 41cf7af60bf1d1962b33f81778ce2e1d135c04b9 | |
parent | 4688035c424a26a8d943c261170988f1b788fa56 (diff) | |
download | json-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.md | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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] ``` |