A trait for roles with class attributes
version 0.27
for my $attr ( HasClassAttributes->meta()->get_all_class_attributes() ) { print $attr->name(); }
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.
Every method provided by this role has an analogous method in \*(C`Class::MOP::Class\*(C' or \*(C`Moose::Meta::Class\*(C' for regular attributes. These methods are exactly like their counterparts in MooseX::ClassAttribute::Trait::Class. This accepts the same options as the Moose::Meta::Attribute \*(C`add_attribute()\*(C' method. However, if an attribute is specified as \*(L"required\*(R" an error will be thrown. If the named class attribute exists, it is removed from the role.
See MooseX::ClassAttribute for details.
Dave Rolsky <[email protected]>
This software is Copyright (c) 2013 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)