module Tree::Utils::JSONConverter

Provides utility methods to convert a {Tree::TreeNode} to and from JSON.

Every serialized node carries its Ruby class name under the json_class key. With the json gem 2.x this is the key the gem inspects itself when parsing with +create_additions: true+. The json gem 3.x removed that option together with the JSON.create_id accessor, so RubyTree emits the key on its own and rebuilds the nodes through {ClassMethods#from_json}, which relies on the on_load parser callback available in both the json gem 2.x and 3.x.