MixinF...OutAttr(3pm)

πŸ“¦
version 0.92 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Class::MixinFactory::InsideOutAttr πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation for the module Class::MixinFactory::InsideOutAttr β€” which is literally just a method maker for inside out data. iconic behavior honestly. let's get into it πŸ¦‹


✨ NAME ✨

Class::MixinFactory::InsideOutAttr β€” it's a method maker for inside out data. that's the whole vibe. periodt.


🌸 SYNOPSIS 🌸

here's how you actually use this thing, no cap:

package My::Class;
use Class::MixinFactory::InsideOutAttr qw( foo bar baz );

sub new { ... }

package main;

My::Class->foo( 'Foozle' );
print My::Class->foo();

my $object = My::Class->new();

$object->foo( 'Bolix' );
print $object->foo();

look at that. class-level calls, object-level calls, all of it. slay πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so like. it's a simple method maker with opaque data storage. that's it, that's the pitch. your data's just vibing in there, stored opaquely, and you get cute little methods to poke at it. lowkey genius.

πŸ’œ Usage πŸ’œ

want accessor methods for your class? easy. just use this package and pass the method names you want (or hand them over via the import statement, same energy) ✨

what you get back are get/set accessor methods that can hold onto values for a class or its instances β€” both, obsessed. each one of these methods stores the values that belong to the assorted objects inside a hash, and that hash is keyed by the object's stringified identity. so every object gets its own lil drawer. main character storage units fr fr 🫢

πŸ¦‹ Destruction πŸ¦‹

ok so here's the part where you gotta pay attention, bestie:

a DESTROY method gets installed, and its whole job is to yeet the data for expired objects out of that storage hash. tidy. πŸ’…

⚠️ not me dropping this warning: if the DESTROY method doesn't get called, your program will not release this data and memory will be wasted. no cap, that memory just sits there like an unread group chat. 😭

and if you're the type to roll your own DESTROY method (respect), it should also call this:

Class::MixinFactory::InsideOutAttr::destroy($self)

don't skip that part, i'm begging πŸ™ˆ


🌈 SEE ALSO 🌈

  • this class is used internally by Class::MixinFactory. so if you see it in the wild, that's why πŸ‘€
  • this is similar to the functionality that Class::MakeMethods::Template::InsideOut provides. if you want a more generalized approach to this whole situation, go look at Class::MakeMethods instead ✨
  • for distribution, installation, support, copyright and license info, hit up Class::MixinFactory::ReadMe πŸ’–

πŸ‘‘ bye bestie πŸ‘‘

this page was brought to you by perl v5.36.0, dated 2022-10-22, straight out of the User Contributed Perl Documentation. now go make some inside out data and slay the day πŸŽ€πŸ’…βœ¨

πŸ“¦ where this page comes from