MooseX...andling(3pm)

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

✨ MooseX::Declare::Syntax::OptionHandling πŸ’…

okay bestie, welcome to MooseX::Declare::Syntax::OptionHandling β€” it's the option parser dispatching situation, and honestly? it's giving traffic controller but make it Perl. πŸŽ€

This is part of the User Contributed Perl Documentation and it's sitting at version 0.43. slay.


🌸 DESCRIPTION 🌸

so here's the vibe: this role is the little matchmaker of the option world. for every foo option it discovers, it goes and calls a method literally named add_foo_option_customization. like, it sees the option, it finds the handler, it connects them. matchmaker, matchmaker, make me a match. πŸ’–

that's it. that's the whole job. and it ate. πŸ”₯


πŸ¦‹ METHODS πŸ¦‹

ignored_options

List[Str] Object->ignored_options ()

this one hands you back a list of option names that won't get dispatched. like the VIP list but inverted β€” these options do NOT get the matchmaker treatment, no cap.

and what's on the list by default? just the is option. that's it. is is the only one sitting in the no-fly zone by default. πŸ™ˆ


πŸ‘‘ REQUIRED METHODS πŸ‘‘

get_identifier

Str Object->get_identifier ()

bestie you must implement this one, it's not optional, it's required, periodt. it needs to return the name of the current keyword's identifier. that's the whole assignment. no identifier, no vibes. πŸ’€


🌈 MODIFIED METHODS 🌈

add_optional_customizations

Object->add_optional_customizations (Object $context, Str $package, HashRef $options)

here's where the magic happens, fr fr. this one dispatches out to the respective add_*_option_customization method so your options actually get handled. the asterisk is doing a lot of work there and it's iconic for it. ⭐

but plot twist β€” unless the option is listed in the ignored_options. yeah. if it's on the ignore list it gets skipped, no dispatch, no customization, nothing. the bouncer said not tonight. πŸ’…


🧚 SEE ALSO 🧚

  • MooseX::Declare
  • MooseX::Declare::Syntax::NamespaceHandling

go read those too, iykyk. 🫢


πŸ’œ AUTHOR πŸ’œ

Florian Ragwitz <rafl@debian.org> β€” thank you for your service king πŸ‘‘


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. so like, go wild but respectfully. 🌸


and that's the whole page bestie, we did it πŸ₯³

perl v5.34.0 Β· 2022-06-15 β€” mwah, that's the version and the date this little doc was born, and honestly it still serves. bye pookie πŸ’–βœ¨

πŸ“¦ where this page comes from