What does the create_additions option do in JSON.parse

json, ruby

Solution

The "additions" are additions to pure JSON. If a hash has the `json_class` key (customizable with `JSON.create_id`), it is deserialized as that class instead of a plain hash.

Problem

I came across the `create_additions` option in rubys JSON.parse docs but I can't seem to find any documentation about it. The rdoc describes the option with: create_additions: If set to false, the Parser doesn't create additions even if a matching class and ::create_id was found. This option defaults to true. Out of curiosity, can anyone explain what this option actually does and what this "additions" feature of JSON.parse is anyways?

Original source