MooX::Rebuild(3pm)

πŸ“¦
version 0.08 Β· 4 versions
, in debian bookworm, ubuntu jammy

πŸ’– MooX::Rebuild πŸ’–

okay so bestie, welcome to the MooX::Rebuild page from the User Contributed Perl Documentation (that's the 3pm manual section, iykyk). this little role is here to let you rebuild your Moo objects and honestly? it's giving genius. ✨


🌸 NAME 🌸

MooX::Rebuild β€” rebuild your Moo objects. that's it, that's the whole vibe. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole thing, copy it, run it, love it:

package Foo;
use Moo;
with 'MooX::Rebuild';
has get_bar => (
    is       => 'ro',
    init_arg => 'bar',
);

my $foo1 = Foo->new( bar => 'lala' );
my $foo2 = $foo1->rebuild();
print $foo2->get_bar(); # lala

like. you made one. now you have two. slay. πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

so what it does is: it makes copies of Moo objects using the same arguments used to create the original objects. no cap, that's the whole deal. πŸ”₯

and lowkey important detail here β€” this Moo role depends on, and uses, the MooX::BuildArgs role in order to capture the original arguments used to create an object. so like, it's not doing the remembering itself, MooX::BuildArgs is the one holding the receipts. 🧚


✨ METHODS ✨

πŸ’… rebuild

my $clone   = $object->rebuild();
my $similar = $object->rebuild( %extra_args );

creates a new instance in the same class as the source object and using the same arguments used to make the source object. and if you pass %extra_args? you get a similar-but-tweaked little guy. main character energy fr fr. πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

  • MooX::BuildArgs
  • MooX::BuildArgsHooks
  • MooX::MethodProxyArgs
  • MooX::SingleArg

go read them too bestie, they're all friends. 🫢


🫢 SUPPORT 🫢

See "SUPPORT" in MooX::BuildArgs. (they got you covered over there, no need to panic πŸ’–)


πŸ‘‘ AUTHORS πŸ‘‘

See "AUTHORS" in MooX::BuildArgs. (yes, the whole credit roll lives over there too ✨)


πŸ“œ LICENSE πŸ“œ

See "LICENSE" in MooX::BuildArgs. (legal stuff, still important, still cute 🌸)


ok and for the sign-off: this page is perl v5.30.3, dated 2020-09-12, and it's MooX::Rebuild(3pm) out here living its best life. mwah. πŸ’‹ πŸŽ€πŸ’–βœ¨
πŸ“¦ where this page comes from