MooseX::AttributeShortcuts::Trait::Role::Attribute(3pm)

MooseX::AttributeShortcuts::Trait::Role::Attribute3pm

Role attribute trait to create builder method

Version

This document describes version 0.037 of MooseX::AttributeShortcuts::Trait::Role::Attribute - released November 20, 2017 as part of MooseX-AttributeShortcuts.

Overview

Normally, attribute options processing takes place at the time an attribute is created and attached to a class, either by virtue of a "has" statement in a class definition or when a role is applied to a class.

This is not an optimal approach for inline builder methods.

This is a role attribute trait, to create builder methods when role attributes are created, so that they can be aliased, excluded, etc, like any other role method.

Role parameters

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

builder_prefix

Around method modifiers

new

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

After method modifiers

attach_to_role

If we have an inline builder defined in our role options, install it as a method.

Methods

builder_method_metaclass()

Returns the metaclass we'll use to install a inline builder.

Releases

4 releases since Debian 10 (Buster); the text changed 1 time.

  1. 10–11
  2. 12–13

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.

Author

Chris Weyl <[email protected]>

From libmoosex-attributeshortcuts-perl 0.037-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.