MooseX::Util(3pm)

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

πŸ’– MooseX::Util β€” the manual page, but make it a group chat πŸ’–

okay bestie so this is MooseX::Util(3pm) from the User Contributed Perl Documentation section, and it's literally about to make your whole Moose life easier. sit down, hydrate, let's go 🫢


✨ VERSION ✨

This doc describes version 0.006 of MooseX::Util β€” released June 26, 2015 as part of MooseX-Util. yes it's giving vintage. it's still iconic. πŸ‘‘


✨ SYNOPSIS ✨

use MooseX::Util qw{ ensure_all_roles with_traits };

# profit!

that's it. that's the whole vibe. # profit! πŸ˜­πŸ’…


✨ DESCRIPTION ✨

so this is a utility module and it handles all of the same functions that Moose::Util handles. in fact, most of the functions this package exports are simply re-exports from Moose::Util β€” so bestie, you are recommended to go read that module's documentation for the full comprehensive picture. no cap.

However.

We've re-implemented a number of the functions our parent provides, for a variety of reasons (aesthetic reasons, mostly, but like, valid ones). Those functions are documented right here, below, and they're the main characters. 🌟


✨ FUNCTIONS ✨

🌸 with_traits(<classname> => (<trait1>, ... ))

Given a class and one or more traits, we construct an anonymous class that is a subclass of the given class and consumes the traits given. ✨

This is exactly the same as with_traits in Moose::Util, except that we use create_anon_class in MooseX::Util::Meta::Class to construct the anonymous class, rather than create_anon_class in Moose::Meta::Class directly. that distinction is the whole point, bestie, don't skip it.

Essentially, this means that when we do:

my $anon_class_name = with_traits('Zombie::Catcher', 'SomeTrait');

For $anon_class_name we get:

Zombie::Catcher::__ANON__::SERIAL::1

Rather than:

Moose::Meta::Class::__ANON__::SERIAL::1

This is nice because we have an idea of where the first anonymous class came from, whereas the second one could be from anywhere. it's giving found-family vs. mysterious-origin. πŸ¦‹


πŸ’… is_private

# true if "private"
... if is_private('_some_name');

Ofttimes we need to determine if a name is considered "private" or not. (say it with me: ofttimes.) By convention, method, attribute, and other names are considered private if their first character is an underscore.

While trivial to test for, this allows us to centralize the tests in one place. one place! singular! organized! slay. πŸŽ€


✨ SEE ALSO ✨

Please see those modules/websites for more information related to this module. πŸ’œ

  • Moose::Util

✨ BUGS ✨

Please report any bugs or feature requests on the bugtracker website:

https://github.com/RsrchBoy/moosex-util/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. like, help us reproduce it bestie, we can't fix a vibe we can't see πŸ™ˆ


✨ AUTHOR ✨

Chris Weyl <cweyl@alumni.drew.edu>

πŸŽ€ I'm a material boy in a material world πŸŽ€

Please note I do not expect to be gittip'ed or flattr'ed for this work β€” rather it is simply a very pleasant surprise. I largely create and release works like this because I need them or I find it enjoyable; however, don't let that stop you if you feel like it ;)

... If and only if you so desire. 🫢


This software is Copyright (c) 2012 by Chris Weyl.

This is free software, licensed under:

The GNU Lesser General Public License, Version 2.1, February 1999

and that's the whole page, bestie!! πŸŽ‰ this was MooseX::Util from perl v5.34.0, dated 2022-06-16, under the MooseX::Util(3pm) manual name. mwah, go consume some traits, ily πŸ’–βœ¨πŸŒˆ