MooseX...Method(3pm)

πŸ“¦
version 0.43 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’… MooseX::Declare::Syntax::Keyword::Method πŸ’…

okay bestie, so this page is MooseX...Method(3pm) from the User Contributed Perl Documentation, and it is literally all about the role that handles method declarations. it's giving ✨plumbing✨ but the important kind, iykyk.

VERSION: version 0.43 πŸŽ€


✨ NAME ✨

MooseX::Declare::Syntax::Keyword::Method β€” Handle method declarations 🫢


🌸 DESCRIPTION 🌸

so this role? it's an extension of MooseX::Declare::Syntax::MethodDeclaration, and what it does is let you install keywords that declare methods. that's it. that's the whole vibe. it's a glow-up on the base declaration role so your keywords can actually spit out methods. πŸ”₯


πŸ’– METHODS πŸ’–

register_method_declaration

Object->register_method_declaration (Object $metaclass, Str $name, Object $method)

this one is required by the method declaration role, and its whole job is to register the finished method object via the $metaclass->add_method method. like, that's the moment where the method actually becomes A Method. main character energy fr fr. πŸ‘‘

MethodModifier->new(
    identifier           => 'around',
    modifier_type        => 'around',
    prototype_injections => {
        declarator => 'around',
        injections => [ 'CodeRef $orig' ],
    },
);

and what that lil config means, bestie, is that the signature (Str $foo) will become CodeRef $orig: Object $self, Str $foo, and () will become CodeRef $orig: Object $self. the injections literally get slotted in at the front, no cap. πŸ¦‹


🧚 CONSUMES 🧚

  • MooseX::Declare::Syntax::MethodDeclaration

🌈 SEE ALSO 🌈

  • MooseX::Declare
  • MooseX::Declare::Syntax::MooseSetup
  • MooseX::Declare::Syntax::MethodDeclaration
  • MooseX::Method::Signatures

πŸ‘‘ AUTHOR πŸ‘‘

Florian Ragwitz <rafl@debian.org> πŸ’œ


This software is copyright (c) 2008 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. slay, honestly. legal but cute. ⭐


ok that's the whole page, you ate it, go forth and declare some methods 🫢

so yeah β€” this page comes to you from perl v5.34.0, dated 2022-06-15, and it's MooseX...Method(3pm) living its best life in the Perl docs. mwah πŸ’‹

πŸ“¦ where this page comes from