MooseX...t::YAML(3pm)

πŸ“¦
version 0.53 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

MooseX::Storage::Format::YAML β€” it's a YAML serialization role, bestie. That's the whole vibe. πŸŽ€


✨ VERSION ✨

version 0.53 πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the whole entire moment, no cap:

package Point;
use Moose;
use MooseX::Storage;

with Storage('format' => 'YAML');

has 'x' => (is => 'rw', isa => 'Int');
has 'y' => (is => 'rw', isa => 'Int');

1;

my $p = Point->new(x => 10, y => 10);

## methods to freeze/thaw into
## a specified serialization format
## (in this case YAML)

# pack the class into a YAML string
$p->freeze();

# ----
# __CLASS__: "Point"
# x: 10
# y: 10

# unpack the JSON string into a class
my $p2 = Point->thaw(<<YAML);
----
__CLASS__: "Point"
x: 10
y: 10
YAML

(and yes the comment really does say JSON in a YAML doc, the source said it, I said it, we're all saying it, moving on 😭)


🌸 METHODS 🌸

  • freeze β€” packs the class into a YAML string 🫢
  • thaw ($yaml) β€” takes a YAML string and unpacks it back into a class, $yaml being the thing you feed it ✨

🫢 SUPPORT 🫢

Found a bug? First of all, iconic of you for caring. File it through the RT bug tracker at <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Storage> β€” or you can email it straight to bug-MooseX-Storage@rt.cpan.org πŸ’Œ

There's also a mailing list for everyone using this distribution, living at <http://lists.perl.org/list/moose.html> 🌈

And there's an irc channel too, for users of this distribution, at #moose on irc.perl.org <irc://irc.perl.org/#moose> β€” come hang, fr fr πŸ’¬


πŸ‘‘ AUTHORS πŸ‘‘

  • Chris Prather <chris.prather@iinteractive.com>
  • Stevan Little <stevan.little@iinteractive.com>
  • Χ™Χ•Χ‘Χœ Χ§Χ•Χ’'מן (Yuval Kogman) <nothingmuch@woobling.org>

three absolute legends, we love to see it ⭐


This software is copyright (c) 2007 by Infinity Interactive, Inc.

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, that's the whole license situation πŸ’…


and that's the page, bestie!! πŸŽ€ this was perl v5.36.0, dated 2022-10-16, from the MooseX...t::YAML(3pm) corner of the user-contributed perl documentation universe. go forth and serialize your little hearts out πŸ¦‹βœ¨
πŸ“¦ where this page comes from