MixinF...Factory(3pm)
π 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
- ubuntu noble: libclass-mixinfactory-perl 0.92-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libclass-mixinfactory-perl 0.92-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libclass-mixinfactory-perl 0.92-5 Β· 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