JSON::Tiny::Subclassable(3pm)

JSON::Tiny::Subclassable3pm

Subclass of json::tiny which in practice is a fork

Overview

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' };

Disclaimer of warranties

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Releases

6 releases since Debian 8 (Jessie); the text changed 2 times.

  1. 8–10
  2. 11
  3. 12–13

Bugs

Please report any bugs to <http://rt.cpan.org/Dist/Display.html?Queue=JSON-MultiValueOrdered>.

Authors

David J. Oswald.

Toby Inkster <[email protected]>.

From libjson-multivalueordered-perl 0.006-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.