MooseX:...::Class(3)
π NAME π
okay bestie, you're reading the MooseX:...::Class(3) manual page from the User Contributed Perl Documentation, and the actual name it's serving is MooseX::ClassAttribute::Trait::Class β a trait for classes with class attributes. slay.
β¨ VERSION β¨
version 0.29 β periodt.
π¦ SYNOPSIS π¦
like, here's the vibe in code:
for my $attr ( HasClassAttributes->meta()->get_all_class_attributes() )
{
print $attr->name();
}
πΈ DESCRIPTION πΈ
This role adds awareness of class attributes to a metaclass object. It gives you a set of introspection methods that largely parallel the existing attribute methods β except these operate on class attributes. no cap.
π METHODS π
Every method provided by this role has an analogous method in Class::MOP::Class or Moose::Meta::Class for regular attributes. iykyk.
π«Ά $meta->has_class_attribute($name) / $meta->get_class_attribute($name) / $meta->get_class_attribute_list()
These methods operate on the current metaclass only. literally just the current one.
β¨ $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 don't do that unless you want the error, bestie.
π $meta->remove_class_attribute($name)
If the named class attribute exists, it is removed from the class, along with its accessor methods. bye attribute π .
π¦ $meta->get_all_class_attributes()
This method returns a list of attribute objects for the class and all its parent classes. the whole family tree, okay?
π $meta->find_class_attribute_by_name($name)
This method looks at the class and all its parent classes for the named class attribute.
π $meta->get_class_attribute_value($name) / $meta->set_class_attribute_value($name, $value) / $meta->set_class_attribute_value($name) / $meta->clear_class_attribute_value($name)
These methods operate on the storage for class attribute values, which is attached to the metaclass object.
There's really no good reason for you to call these methods unless you're doing some deep hacking. They are named as public methods solely because they are used by other meta roles and classes in this distribution. like, they're public for internal reasons, not because you should casually call them. π
π 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.
π«Ά AUTHOR π«Ά
Dave Rolsky <autarch@urth.org>
π 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 page, mwah π β source/version footer says perl v5.42.0, date 2016-05-31, and the page is MooseX:...::Class(3). bye bestie π«Άβ¨
π¦ 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