MooseX::ClassAttribute::Trait::Role(3pm)

MooseX::ClassAttribute::Trait::Role3pm

A trait for roles with class attributes

Usage

  for my $attr ( HasClassAttributes->meta()->get_all_class_attributes() )
  {
      print $attr->name();
  }

Version

version 0.29

Overview

This role adds awareness of class attributes to a role metaclass object. It provides a set of introspection methods that largely parallel the existing attribute methods, except they operate on class attributes.

Methods

Every method provided by this role has an analogous method in "Class::MOP::Class" or "Moose::Meta::Class" for regular attributes.

$meta->has_class_attribute($name)

$meta->get_class_attribute($name)

$meta->get_class_attribute_list()

These methods are exactly like their counterparts in MooseX::ClassAttribute::Trait::Class.

$meta->add_class_attribute(...)

This accepts the same options as the Moose::Meta::Attribute "add_attribute()" method. However, if an attribute is specified as "required" an error will be thrown.

$meta->remove_class_attribute($name)

If the named class attribute exists, it is removed from the role.

Releases

6 releases since Debian 8 (Jessie); the text changed 2 times.

  1. 8
  2. 9–11
  3. 12–13

Bugs

See MooseX::ClassAttribute for details.

Bugs may be submitted through the RT bug tracker <http://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-ClassAttribute> (or [email protected] <mailto:[email protected]>).

I am also usually active on IRC as 'drolsky' on "irc://irc.perl.org".

Author

Dave Rolsky <[email protected]>

From libmoosex-classattribute-perl 0.29-3 in Debian 13 (Trixie). Parsed by carta from the page's man source.