JSON::...ssable(3pm)

πŸ“¦
version 0.006 Β· 2 versions
  • 0.006 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 0.006 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ¦‹ 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)
  • 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 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>.

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