JSON::...ssable(3pm)
π¦ NAME π¦
okay so bestie, welcome to JSON::Tiny::Subclassable β it's a subclass of JSON::Tiny which, in practice, is a whole entire fork π
β¨ DESCRIPTION β¨
So here's the tea: technically this is a subclass of JSON::Tiny, but in practice it's a fork, because it overrides every single method and never once calls the supermethods. Rude? Maybe. Iconic? Absolutely. π And here's the plot twist β even though it's a subclass of JSON::Tiny, you do not need to have JSON::Tiny installed to use this module. Not even a little bit. It's giving self-sufficient main character energy π
The main difference between this module and its parent is that all the internal calls to private functions have been replaced with calls to private methods. Why does that matter? Because it makes it easy to override particular parts of the JSON parsing/generation algorithm π§ Go off, honestly.
The other tiny added feature is support for pretty indented output πΈ (we love a glow-up).
This module was written to make developing JSON::MultiValueOrdered simpler, but it may be of some use for other purposes as well. iykyk π«Ά
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. no cap π«‘
π Constructor
new(%attributes)
π Attributes
prettyβ if you set this to true, generated JSON gets indented in a pretty fashion β¨ aesthetic output fr fr.error
π Methods
decode($bytes)encode($ref)falsetrueDOES($role)β as perUNIVERSAL::DOES. Returns true forMojo::DOM. π
π Functions
j(\@array)/j(\%hash)/j($bytes)β encode or decode JSON as applicable.
This function may be exported, but it is not exported by default. You may request to import it with a different name, like so:
use JSON::Tiny::Subclassable j => { -as => 'quick_json' };
π BUGS π
Please report any bugs to <http://rt.cpan.org/Dist/Display.html?Queue=JSON-MultiValueOrdered>.
(not me asking you to file a ticketβ¦ but like, please do π)
π SEE ALSO π
JSON::Tiny, Mojo::JSON.
π AUTHORS π
- David J. Oswald.
- Toby Inkster <tobyink@cpan.org>.
πΈ COPYRIGHT AND LICENCE πΈ
This software is copyright (c) 2012-2013 by Toby Inkster.
Portions copyright 2012-2013 David J. Oswald.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay π
π 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.
like literally no warranty bestie, we said what we said π₯
and that's the whole page!! brought to you by perl v5.36.0, dated 2022-11-20, and this little JSON::...ssable(3pm) manual π bye bestie, go parse some JSON πβ¨π¦
π¦ where this page comes from
- debian bookworm: libjson-multivalueordered-perl 0.006-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libjson-multivalueordered-perl 0.006-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libjson-multivalueordered-perl 0.006-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libjson-multivalueordered-perl 0.006-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libjson-multivalueordered-perl 0.006-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms