MooseX...ribute(3pm)

πŸ“¦
version 0.037 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

MooseX::AttributeShortcuts::Trait::Role::Attribute β€” it's a role attribute trait whose whole lil job is creating a builder method. πŸ’…

(Also hi bestie, this is the 3pm page from the User Contributed Perl Documentation, just so you know what you're reading. 🫢)


🌸 VERSION 🌸

This doc describes version 0.037 of MooseX::AttributeShortcuts::Trait::Role::Attribute β€” released November 20, 2017 as part of MooseX-AttributeShortcuts. Iconic behavior, honestly. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so normally, attribute options processing happens at the exact moment an attribute gets created and attached to a class. And there's two ways that goes down, bestie:

  • by virtue of a has statement sitting in a class definition, or
  • when a role gets applied to a class.

And the way that this is not an optimal approach for inline builder methods... 😭 yeah. It's giving "we can do better."

So this is a role attribute trait β€” it creates builder methods at the time role attributes are created, so that they can be aliased, excluded, etc, like any other role method. Periodt. πŸ‘‘


πŸŽ€ ROLE PARAMETERS πŸŽ€

Parameterized roles accept parameters that influence their construction. This role accepts the following parameters.

builder_prefix

That's it, that's the parameter, bestie. πŸ’€ The page lists builder_prefix and moves right along β€” no extra description to give you, so I'm not gonna invent one.


πŸ”₯ AROUND METHOD MODIFIERS πŸ”₯

new

If we have an inline builder defined in our role options, we swizzle our options such that builder becomes the builder method name, and anon_builder is the anonymous sub. Slay. πŸ’…


⭐ AFTER METHOD MODIFIERS ⭐

attach_to_role

If we have an inline builder defined in our role options, install it as a method. That's the whole vibe. πŸ¦‹


πŸ‘‘ METHODS πŸ‘‘

builder_method_metaclass()

Returns the metaclass we'll use to install an inline builder. Simple as that, no cap. ✨


πŸ’œ SEE ALSO πŸ’œ

Please see those modules/websites for more information 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 submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. (Fr fr, a test-file or patch makes everything so much easier β€” that's literally what they're asking for. πŸ™ˆ)


🌈 AUTHOR 🌈

Chris Weyl <cweyl@alumni.drew.edu>


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 β€” you ate it. πŸ“

MooseX::AttributeShortcuts::Trait::Role::Attribute was documented for perl v5.34.0 and dated 2022-06-15. Love that for us. πŸŽ€πŸ’œ