MooseX...cessor(3pm)
π NAME π
MooseX::SemiAffordanceAccessor β bestie, it's literally here to name your accessors foo() and set_foo(). That's the whole gig. π
β¨ VERSION β¨
version 0.10 β yes she's serving vintage, and yes she still slays.
π¦ SYNOPSIS π¦
use Moose;
use MooseX::SemiAffordanceAccessor;
# make some attributes
That's it. That's the vibe. Go make some attributes, queen. π
πΈ DESCRIPTION πΈ
okay so here's the tea π β this module is not out here handing you a bunch of methods. Nope. The only thing it does is vibe-check the default naming policy of whatever class loaded it, and switch things up so your accessors get split into a get method and a set method. No cap.
- The get methods keep the same name as the accessor. Iconic. β¨
- The set methods get prefixed with
set_. Periodt. π
And if you define an attribute with a leading underscore? Then the set method is gonna start with _set_ instead. She matches your energy. π§
Now β if you explicitly set a reader or writer name when you're creating an attribute, then that attribute's naming scheme is left unchanged. She doesn't touch what you already named yourself, that would be rude. π
Fun fact that's lowkey highkey cute: the name "semi-affordance" comes from David Wheeler's Class::Meta module. π
π ACCESSORS IN ROLES π
Okay this part is a whole saga, so sit down bestie. π«Ά
Back prior to version 1.9900 of Moose, attributes that got added to a class ended up with that class's attribute traits. So likeβ¦ if your class used MooseX::SemiAffordanceAccessor, then any attributes provided by roles you consumed would end up with the semi-affordance style of accessor too. They got dragged along for the ride. π
As of Moose 1.9900, that is no longer the case. Attributes provided by roles no longer acquire the consuming class's attribute traits. The era of accidental drip-transfer is over. π
BUT. π«’ With Moose 1.9900+, you can now use MooseX::SemiAffordanceAccessor directly in roles. And any attributes defined by that role will have semi-affordance style accessors, regardless of what attribute traits the consuming class has. That's the glow-up. That's main character energy. πβ
π BUGS π
Found a bug? Got a feature request? Don't suffer in silence, bestie. π Report it to bug-moosex-semiaffordanceaccessor@rt.cpan.org, or slide through the web interface at <http://rt.cpan.org>.
The author will be notified, and then you'll automatically be notified of progress on your bug as changes get made. So like, you will get updates. No ghosting. π«Ά
π AUTHOR π
Dave Rolsky <autarch@urth.org> β we stan. π
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2011 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
Free software, GPL compatible, iconic behaviour fr fr. β¨
and that's the whole page, bestie β this was MooseX...cessor(3pm) from the User Contributed Perl Documentation, built on perl v5.34.0 and dated 2022-06-15. go forth and name your accessors beautifully π
πΈπ¦
π¦ where this page comes from
- debian bookworm: libmoosex-semiaffordanceaccessor-perl 0.10-2 Β· Artistic-2.0
- debian trixie: libmoosex-semiaffordanceaccessor-perl 0.10-2 Β· Artistic-2.0
- ubuntu noble: libmoosex-semiaffordanceaccessor-perl 0.10-2 Β· Artistic-2.0
- ubuntu resolute: libmoosex-semiaffordanceaccessor-perl 0.10-2 Β· Artistic-2.0
- ubuntu stonking: libmoosex-semiaffordanceaccessor-perl 0.10-2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms