MooseX...::Class(3pm)

πŸ“¦
version 0.32 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ¦‹ MooseX::MethodAttributes::Role::Meta::Class πŸ’…

okay bestie, so this is a page from the User Contributed Perl Documentation collection, and it's the manual for MooseX::MethodAttributes::Role::Meta::Class β€” a metaclass role that's literally just vibing there, storing your code attributes. that's its whole job. it's giving ✨backstage crew✨. nobody sees it, but the show does not go on without it.


✨ VERSION ✨

version 0.32 β€” that's the one, that's the moment πŸŽ€


🧚 METHODS 🧚

these are the three little functions this role hands you. all of them are about meta methods that have attributes. periodt.

  • get_method_with_attributes_list β€” grabs you the list of meta methods for the local methods of this class that have attributes, in the exact order they were registered. no sorting, no shuffling, just the order they showed up in. πŸ’–
  • get_all_methods_with_attributes β€” same idea but bigger: this one gets the meta methods of both local and inherited methods that have attributes. and the ordering rules? iconic, honestly:
    • base class methods come before subclass methods
    • within one single class, methods keep the order they were declared in
  • get_nearest_methods_with_attributes β€” basically the same as get_all_methods_with_attributes, with one big twist: methods from parent classes get left out if there's an attribute-less method hanging out in a child class. the child wins. sorry to the ancestors, it's giving main character energy πŸ‘‘

so like, for example, given this:

package BaseClass;

sub foo : Attr {}

sub bar : Attr {}

package SubClass;
use base qw/BaseClass/;

sub foo {}

after bar => sub {}

SubClass->meta->get_all_methods_with_attributes will return BaseClass->meta->get_method('foo') for the example above. but this method will not β€” it'll return the wrapped bar method instead, whereas get_all_methods_with_attributes returns the original method. subtle difference, huge consequences, iykyk πŸ’€


🌸 SUPPORT 🌸

got a bug? bestie, don't suffer in silence, submit it through the RT bug tracker:

https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-MethodAttributes

or you can email it straight to:

bug-MooseX-MethodAttributes@rt.cpan.org

there's also a mailing list for users of this distribution, right here:

http://lists.perl.org/list/moose.html

and if you wanna just chat, there's an irc channel for users of this distribution too: #moose on irc.perl.org, aka irc://irc.perl.org/#moose 🫢


πŸ‘‘ AUTHORS πŸ‘‘

  • Florian Ragwitz <rafl@debian.org>
  • Tomas Doran <bobtfish@bobtfish.net>

absolute legends, no cap πŸŽ€


This software is copyright (c) 2009 by Florian Ragwitz.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

so yeah, go wild, remix it, redistribute it β€” just keep it under the same terms as Perl 5 itself. it's free, it's generous, it's the community spirit fr fr 🌈

and that's the whole page, bestie!! 🌟 this one shipped as perl v5.30.3 and got dated <yellow>2020-08-31</yellow> β€” a little time capsule from the MooseX...::Class(3pm) era. go forth and attribute responsibly πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from