Although technically this is a subclass of JSON::Tiny, in practice it's a fork because it overrides every
method, and never calls the supermethods. In fact, even though this is a subclass of JSON::Tiny, you
don't need to have the latter installed to use this module.
The main difference between this module and its parent is that all the internal calls to private
functions have been replaces with calls to private methods. This makes it easy to override particular
parts of the JSON parsing/generation algorithm.
The other tiny added feature is to support pretty indented output.
This module was written to make developing JSON::MultiValueOrdered simpler, but it may be of some use for
other purposes as well.
JSON::Tiny::Subclassable is a subclass of JSON::Tiny, which is itself a fork of Mojo::JSON. Except where
noted, the methods listed below behave identically to the methods of the same names in the superclass.
Constructor
"new(%attributes)"
Attributes
"pretty"
If set to true, indents generated JSON in a pretty fashion.
"error"
Methods
"decode($bytes)"
"encode($ref)"
"false"
"true"
"DOES($role)"
As per UNIVERSAL::"DOES". Returns true for Mojo::DOM.
Functions
"j(\@array)" / "j(\%hash)" / "j($bytes)"
Encode or decode JSON as applicable.
This function may be exported, but is not exported by default. You may request to import it with a
different name:
use JSON::Tiny::Subclassable j => { -as => 'quick_json' };