MooseX:...it::Role(3)
hey bestie π welcome to the MooseX:...it::Role(3) page β yes, thatβs the manual name folded in right up top, from the User Contributed Perl Documentation. buckle up, weβre doing class attributes in roles and itβs lowkey iconic.
πΈ NAME πΈ
MooseX::ClassAttribute::Trait::Role β A trait for roles with class attributes. thatβs the whole vibe: a trait, for roles, with class attributes. periodt.
β¨ VERSION β¨
version 0.29 β short, sweet, slaying.
π SYNOPSIS π
okay so this is the little loop they show you:
for my $attr ( HasClassAttributes->meta()->get_all_class_attributes() )
{
print $attr->name();
}
cute, right? it walks all the class attributes and prints their names. no cap.
π¦ DESCRIPTION π¦
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. itβs giving βsame energy, but for class attributes.β π
π METHODS π
Every method provided by this role has an analogous method in Class::MOP::Class or Moose::Meta::Class for regular attributes. so if you already know those, youβre lowkey already fluent. iykyk.
$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. no extra plot twists.
$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. so bestie, do not mark it required unless youβre ready for the drama π.
$meta->remove_class_attribute($name)
If the named class attribute exists, it is removed from the role. simple as that. poof. β¨
π 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 bug-moosex-classattribute@rt.cpan.org <mailto:bug-moosex-classattribute@rt.cpan.org>).
I am also usually active on IRC as 'drolsky' on irc://irc.perl.org. so yeah, thatβs the bug-reporting situation, fr fr.
π AUTHOR π
Dave Rolsky <autarch@urth.org>. iconic.
π COPYRIGHT AND LICENCE π
This software is Copyright (c) 2016 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
okay thatβs the whole manual page β footer sign-off vibes: source/version perl v5.42.0, date 2016-05-31, and the manual name MooseX:...it::Role(3). bye bestie, go introspect those class attributes π«Ά
π¦ where this page comes from
- opensuse-leap 16.0: perl-MooseX-ClassAttribute 0.29-bp160.1.10 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms