MooseX...ration(3pm)

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

πŸ’– MooseX::Declare::Syntax::MethodDeclaration β€” ok bestie, let's talk πŸ’–

aka MooseX...ration(3pm) β€” yeah the header truncated it, that's just the manual name doing its little thing, don't worry about it πŸŽ€

VERSION: version 0.43 ✨


🌸 DESCRIPTION 🌸

It's a role for keyword handlers, okay? Like, it hands you a whole framework so you can add methods β€” or add things that merely look like methods, which, same energy honestly β€” and modify them. That's the whole vibe. πŸ¦‹


πŸŽ€ ATTRIBUTES πŸŽ€

prototype_injections

Optional little structure that describes extra stuff to be injected into a method's signature. πŸ’…

The popular example of this? It lives in the around method modifier handler:

ngl that's where everyone points when they want to see it in the wild 🫢

✨ METHODS ✨

parse

Object->parse (Object $ctx);

Reads a name and a prototype, builds the method meta object, and then registers it into the current class. How? Using MooseX::Method::Signatures plus a custom_method_application that calls register_method_declaration. That's the whole pipeline, no cap. πŸ”₯


πŸ‘‘ CONSUMES πŸ‘‘

  • MooseX::Declare::Syntax::KeywordHandling

🌈 REQUIRED METHODS 🌈

register_method_declaration

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

This one gets called with the target metaclass, the final built method meta object, and its name. And here's the iconic part: whatever it returns becomes the value returned right where the method was declared. So like… the return value is the whole point. main character behaviour fr πŸ’«


πŸ’œ SEE ALSO πŸ’œ

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

πŸ¦‹ AUTHOR πŸ¦‹

Florian Ragwitz <rafl@debian.org> β€” the legend himself πŸ’–


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. 🌸


okay and the lil sign-off from the bottom of the page: this is from perl v5.34.0, dated 2022-06-15, and the manual is MooseX...ration(3pm). that's it, that's the page, slay πŸ’…βœ¨

πŸ“¦ where this page comes from