MooseX...ribute(3pm)
β¨ NAME β¨
MooseX::AttributeShortcuts::Trait::Attribute β the Shortcuts attribute trait, but like, the actual one bestie π
π VERSION π
This doc is describing version 0.037 of MooseX::AttributeShortcuts::Trait::Attribute β which dropped on November 20, 2017 as part of MooseX-AttributeShortcuts. Iconic release date, no cap. β¨
πΈ DESCRIPTION πΈ
Okay so this right here? This is the real attribute trait that does all the heavy lifting behind MooseX::AttributeShortcuts. If you wanna know about any of the shiny new attribute options, go read that package's docs instead β because this page is mainly here to document the extra attributes, methods, and role parameters that this role brings to the party. π«Ά
And listen β every method we hook in that chains off Moose's _process_options() gets the _mxas_ prefix, and generally those aren't documented in the POD at all. But any internal methods of Moose::Meta::Attribute that we wrap or otherwise override? Yeah, those we do document here too. Bestie behavior fr fr. π
π ROLE PARAMETERS π
Parameterized roles accept parameters that influence their construction β like little settings you hand over at build time, and they shape how the thing gets made. This role accepts the following ones:
writer_prefix
builder_prefix
(yes those are just the two names, sitting there, being parameters π)
π¦ ATTRIBUTES π¦
constraint
A CodeRef, and it's read-only. So likeβ¦ look, don't touch. π
original_isa
(that's it, that's the whole entry β she's mysterious, she's an attribute, we move on π)
trigger_method
Holds the name of the method that's gonna get invoked as a trigger. Slay.
π₯ BEFORE METHOD MODIFIERS π₯
_process_options
So here's the tea: we wrap _process_options() instead of the newer _process_is_option(), because honestly that makes our life way easier from a Moose 1.x/2.x compatibility standpoint β and also because we're generally messing with more than just the 'is' option at one time anyway. Multitasking queen. π
π AROUND METHOD MODIFIERS π
_make_delegation_method
Right here is where we create and install any custom accessors that have been defined. Boom. β¨
β AFTER METHOD MODIFIERS β
attach_to_class
We hijack attach_to_class so we can install our anon_builder, if we have one. And just so you know β we do not go the normal associate_method/install_accessor/etc route, because this is kindaβ¦ different. (Translation: the builder is not an accessor of this attribute, and it should not be installed as one. Don't do it. π«)
π METHODS π
has_constraint
Predicate for the "constraint" attribute. π
has_original_isa
Predicate for the "original_isa" attribute. π
has_trigger_method
Predicate for the "trigger_method" attribute. π
builder_method_metaclass()
Returns the metaclass we're gonna use to install a inline builder. π (yes, "a inline", we said what we said)
canonical_writer_prefix
Returns the writer prefix; this is almost always "set_". Periodt.
canonical_builder_prefix
Returns the builder prefix; this is almost always "_build_". Also periodt.
π PREFIXES π
We accept two parameters when you use this module β and they impact how builders and writers get named. Naming rights, basically. π§
-writer_prefix
use MooseX::::AttributeShortcuts -writer_prefix => 'prefix';
The default writer prefix is "_set_". If you'd prefer it to be something else (say, "_"), this is exactly where you'd do that. Go off. π
-builder_prefix
use MooseX::AttributeShortcuts -builder_prefix => 'prefix';
The default builder prefix is "_build_" β because that's what "lazy_build" in Moose does, and because that's what people in general recognize as build methods. It's giving tradition. β¨
πΈ SEE ALSO πΈ
Please go peek at these modules/websites for more info related to this module:
MooseX::AttributeShortcuts
π BUGS π
Please report any bugs or feature requests on the bugtracker website <https://github.com/RsrchBoy/moosex-attributeshortcuts/issues> π«Ά
When you're submitting a bug or a request, please include a test-file β or a patch to an existing test-file β that illustrates the bug or the desired feature. Like, actually show us, bestie. That's the whole vibe check. π
β¨ AUTHOR β¨
Chris Weyl <cweyl@alumni.drew.edu> π
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2017, 2015, 2014, 2013, 2012, 2011 by Chris Weyl.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999
and that's the whole page, bestie!! this was MooseX...ribute(3pm) from the User Contributed Perl Documentation, running on perl v5.34.0, dated 2022-06-15. stay slay, stay documented, mwah π πβ¨
π¦ where this page comes from
- debian bookworm: libmoosex-attributeshortcuts-perl 0.037-2 Β· LGPL-2.1-only
- debian trixie: libmoosex-attributeshortcuts-perl 0.037-2 Β· LGPL-2.1-only
- ubuntu noble: libmoosex-attributeshortcuts-perl 0.037-2 Β· LGPL-2.1-only
- ubuntu resolute: libmoosex-attributeshortcuts-perl 0.037-2 Β· LGPL-2.1-only
- ubuntu stonking: libmoosex-attributeshortcuts-perl 0.037-2 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms