MixinF...Factory(3pm)

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

πŸ’– NAME πŸ’–

Class::MixinFactory::HasAFactory β€” bestie, it's literally just Delegates to a Factory. That's the whole vibe. It hands the work off. ✨


🌸 SYNOPSIS 🌸

okay so here's the whole thing in action, no cap:

package My::BaseClass;
@ISA = 'Class::MixinFactory::HasAFactory';
sub new { ... }
sub foo { return "Foo Bar" }

package My::Logging;
sub foo { warn "Calling foo"; (shift)->NEXT('foo', @_) }

package My::UpperCase;
sub foo { uc( (shift)->NEXT('foo', @_) ) }

package main;
use My::BaseClass;
print My::BaseClass->class()->new()->foo();
print My::BaseClass->class( 'Logging' )->new()->foo();
print My::BaseClass->class( 'UpperCase' )->new()->foo();
print My::BaseClass->class( 'Logging', 'UpperCase' )->new()->foo();

look at that. four prints. four completely different personalities. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So. Class::MixinFactory::HasAFactory is a class for use by classes which want a factory method. That's it, that's the job description. πŸ’–

Inherit from this class to obtain the class() factory method, described below. She's a giver. She just wants you to have the method. πŸ‘‘


πŸŽ€ PUBLIC METHODS πŸŽ€

⭐ mixin_factory()

BaseClass->mixin_factory() : $factory_object

Gets the associated mixin factory. It's generated the first time it's needed β€” so like, lowkey lazy in the best way possible, it shows up exactly when you need her and not a second earlier. 🧚

⭐ class()

BaseClass->class( @mixins ) : $package_name

Calls the class() method on the associated mixin factory. Yes, it's class() calling class(). It's giving delegation. It's giving main character energy. 😌


🌈 SEE ALSO 🌈

  • For a facade interface that facilitates access to this functionality, see Class::MixinFactory.
  • For distribution, installation, support, copyright and license information, see Class::MixinFactory::ReadMe.

πŸ’€ heads up bestie, this page lives in the User Contributed Perl Documentation section of the manual, and the page itself is Class::MixinFactory::HasAFactory(3pm) β€” iykyk. 🫢

this whole thing is from perl v5.36.0, dated 2022-10-22, and honestly? iconic. periodt. πŸ‘‘πŸŒΈπŸ’œ

πŸ“¦ where this page comes from