MooseX...struct(3pm)
π NAME π
okay so in your man reader this page shows up as MooseX...struct(3pm), and the actual module behind it is MooseX::Blessed::Reconstruct β it's a Data::Visitor whose whole job is creating Moose objects out of blessed placeholders. bestie it's giving magic β¨
π VERSION π
version 1.01 π«Ά yes we're on 1.01, no notes.
π¦ SYNOPSIS π¦
use MooseX::Blessed::Reconstruct;
my $obj = bless( {
init_arg_foo => "Blah",
arf => "yay",
}, "Foo" );
my $proper = MooseX::Blessed::Reconstruct->new->visit($obj);
# equivalent to:
my $proper = Foo->meta->new_object(%$obj);
# but recursive (and works with shared references)
πΈ DESCRIPTION πΈ
so the entire purpose of this module is to "fix up" blessed data and turn it into a real, actual, living-and-breathing Moose object. that's the mission. that's the whole vibe. π
β¨ METHODS β¨
go check out Data::Visitor, that's where the family lives, iykyk.
π§ new
Constructor. periodt.
arguments
load_classesβ if it'strue(and it is the default, obvi), we try torequireits class whenever the target object getsvisited. β¨
π load_classes
a read/write accessor for the load_classes attribute. if it's true, we try to require its class whenever a target object is visited. same energy, different door. πͺ
π visit_object $object
calls load_class in Class::MOP on the ref of $object.
if there's a metaclass, it calls visit_object_with_meta; if not, visit_ref gets deployed to walk the object brutishly. π iconic honestly.
returns a deep clone of the input structure, with all the Moose objects reconstructed "properly".
π visit_object_with_meta $obj, $meta
takes the metaclass $meta, uses it to create a new instance, registers that instance with Data::Visitor's cycle tracking, and then inflates it using new_object in Moose::Meta::Class. slay.
π prepare_args $obj
collapses $obj down into key value pairs, ready to be used as init args to new_object in Moose::Meta::Class. little squish, big purpose. π«Ά
π AUTHORS π
- Yuval Kogman
<nothingmuch@woobling.org> - Jonathan Rockway
<jrockway@cpan.org> - Yanick Champoux
<yanick@cpan.org>
the girls that get it, get it. π
β COPYRIGHT AND LICENSE β
this software is copyright (c) 2018, 2014 by Infinity Interactive, Yuval Kogman.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
so yeah, free as in go off, bestie β same terms as Perl 5 itself, no cap.
okay that's the whole page!! π¦ this was generated under perl v5.28.1, dated 2018-12-21, and honestly? it ate. π
β¨
π¦ where this page comes from
- debian bookworm: libmoosex-blessed-reconstruct-perl 1.01-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoosex-blessed-reconstruct-perl 1.01-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libmoosex-blessed-reconstruct-perl 1.01-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoosex-blessed-reconstruct-perl 1.01-1 Β· 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