---
name: "MooseX::AttributeShortcuts::Trait::Attribute"
section: "3pm"
platform: "linux"
package: "libmoosex-attributeshortcuts-perl"
version: "0.037-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/MooseX::AttributeShortcuts::Trait::Attribute"
---

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

Shortcuts attribute trait proper

## NAME

MooseX::AttributeShortcuts::Trait::Attribute - Shortcuts attribute trait proper

## VERSION

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

## DESCRIPTION

This is the actual attribute trait that implements MooseX::AttributeShortcuts.  You should consult that package's documentation for information on any of the new attribute options; we're mainly going to document the additional attributes, methods, and role parameters that this role provides.

All methods we include that chain off Moose's `"_process_options()"` are prefixed with `"_mxas_"` and generally are not documented in the POD; we document any internal methods of Moose::Meta::Attribute that we wrap or otherwise override we document here as well.

## ROLE PARAMETERS

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

### writer\_prefix

### builder\_prefix

## ATTRIBUTES

### constraint

CodeRef, read-only.

### original\_isa

### trigger\_method

Contains the name of the method that will be invoked as a trigger.

## BEFORE METHOD MODIFIERS

### \_process\_options

Here we wrap **\_process\_options()** instead of the newer **\_process\_is\_option()**, as that makes our life easier from a Moose 1.x/2.x compatibility perspective -- and that we're generally altering more than just the 'is' option at one time.

## AROUND METHOD MODIFIERS

### \_make\_delegation\_method

Here we create and install any custom accessors that have been defined.

## AFTER METHOD MODIFIERS

### attach\_to\_class

We hijack attach\_to\_class in order to install our anon\_builder, if we have one.  Note that we don't go the normal associate\_method/install\_accessor/etc route as this is kinda...  different.  (That is, the builder is not an accessor of this attribute, and should not be installed as such.)

## 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'll use to install a inline builder.

### canonical\_writer\_prefix

Returns the writer prefix; this is almost always `"set_"`.

### canonical\_builder\_prefix

Returns the builder prefix; this is almost always `"_build_"`.

## PREFIXES

We accept two parameters on the use of this module; they impact how builders and writers are named.

### -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 where you'd do that.

### -builder\_prefix

```
    use MooseX::AttributeShortcuts -builder_prefix => 'prefix';
```

The default builder prefix is `"_build_"`, as this is what "lazy\_build" in Moose does, and what people in general recognize as build methods.

## 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.

## 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
```
