MooseX...oClone(3pm)

πŸ“¦
version 0.06 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– MooseX::Clone::Meta::Attribute::Trait::NoClone πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation (that's the 3pm section of the manual, iykyk) and it's literally about one tiny iconic trait that does exactly one job. no cap.


✨ NAME ✨

MooseX::Clone::Meta::Attribute::Trait::NoClone β€” a trait for attributes that should not be copied while cloning 🫢

🌸 VERSION 🌸

version 0.06 β€” she's vintage, she's stable, she's fine πŸ’…

πŸŽ€ SYNOPSIS πŸŽ€

with qw(MooseX::Clone);

has _some_special_thingy => (
    traits => [qw(NoClone)],
);

like… that's it. that's the whole vibe. you slap NoClone in the traits array and that attribute is officially not coming with you when you clone. πŸ¦‹

πŸ’œ DESCRIPTION πŸ’œ

so real talk: sometimes certain values should not be carried over when cloning an object. πŸ™ˆ

maybe it's a cached thing, maybe it's a connection, maybe it's just your business and nobody needs to inherit it. doesn't matter β€” this attribute trait implements just that.

⭐ METHODS ⭐

  • clone_value β€” okay so here's the tea β˜•. If the init_arg param is set (and bestie, that means an explicit value was actually given to clone), then it sets the attribute to that value. πŸ’–

Otherwise β€” meaning nobody handed it a value β€” it calls clear_value and then initialize_instance_slot. so it just… clears the slate and re-inits the slot. clean girl behaviour. ✨

πŸ‘‘ AUTHOR πŸ‘‘

XXXX XXX'XX (Yuval Kogman) <nothingmuch@woobling.org> β€” periodt, that's the author, respect the name πŸ’œ

This software is copyright (c) 2008 by XXXX XXX'XX (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. πŸͺ slay.


no clone, no problem. take the NoClone trait, leave the baggage behind. πŸ’…

and that's the whole page bestie!! this came to you from perl v5.34.0, dated 2022-06-15, out of the MooseX...oClone(3pm) manual β€” love her, read her, use her. πŸ’–πŸŽ€πŸ¦‹πŸŒΈβœ¨

πŸ“¦ where this page comes from