json
json copied to clipboard
How to use both, pure and ext variant
Hi,
(until fix for https://github.com/flori/json/issues/515 gets released,) we want to use the pure variant to pretty generate some of our json (where it is important to have correct formatting), however for everything else the ext variant is preferred, as it is faster. Two problems arise with this:
- I haven't figured out in the docs how to explicitly use a specific variant while both are loaded. There is only one global object JSON which exposes the pretty_generate function. JSON::Ext or JSON::Pure do not. So how to explicitly call json pure pretty_generate?
- Whatever order I do the imports:
require "json/ext"/require "json/pure", in both casesJSON::Generatorresolves toJSON::Pure::Generator. How to load both variants and letJSON::Ext::Generatorbe the default?