.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.42) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "MooseX::Util 3pm" .TH MooseX::Util 3pm "2022-06-16" "perl v5.34.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" MooseX::Util \- Moose::Util extensions .SH "VERSION" .IX Header "VERSION" This document describes version 0.006 of MooseX::Util \- released June 26, 2015 as part of MooseX-Util. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use MooseX::Util qw{ ensure_all_roles with_traits }; \& \& # profit! .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This is a utility module that handles all of the same functions that Moose::Util handles. In fact, most of the functions exported by this package are simply re-exports from Moose::Util, so you're recommended to read the documentation of that module for a comprehensive view. .PP However. .PP We've re-implemented a number of the functions our parent provides, for a variety of reasons. Those functions are documented here. .SH "FUNCTIONS" .IX Header "FUNCTIONS" .SS "with_traits( => (, ... ))" .IX Subsection "with_traits( => (, ... ))" 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 \*(L"with_traits\*(R" in Moose::Util, except that we use \&\*(L"create_anon_class\*(R" in MooseX::Util::Meta::Class to construct the anonymous class, rather than \*(L"create_anon_class\*(R" in Moose::Meta::Class directly. .PP Essentially, this means that when we do: .PP .Vb 1 \& my $anon_class_name = with_traits(\*(AqZombie::Catcher\*(Aq, \*(AqSomeTrait\*(Aq); .Ve .PP For \f(CW$anon_class_name\fR we get: .PP .Vb 1 \& Zombie::Catcher::_\|_ANON_\|_::SERIAL::1 .Ve .PP Rather than: .PP .Vb 1 \& Moose::Meta::Class::_\|_ANON_\|_::SERIAL::1 .Ve .PP This is nice because we have an idea of where the first anonymous class came from, whereas the second one could could be from anywhere. .SS "is_private" .IX Subsection "is_private" .Vb 2 \& # true if "private" \& ... if is_private(\*(Aq_some_name\*(Aq); .Ve .PP Ofttimes we need to determine if a name is considered \*(L"private\*(R" or not. By convention, method, attribute, and other names are considered private if their first character is an underscore. .PP While trivial to test for, this allows us to centralize the tests in one place. .SH "SEE ALSO" .IX Header "SEE ALSO" Please see those modules/websites for more information related to this module. .IP "\(bu" 4 Moose::Util .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests on the bugtracker website https://github.com/RsrchBoy/moosex\-util/issues .PP 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. .SH "AUTHOR" .IX Header "AUTHOR" Chris Weyl .SS "I'm a material boy in a material world" .IX Subsection "I'm a material boy in a material world" Please note \fBI do not expect to be gittip'ed or flattr'ed for this work\fR, rather \fBit is simply a very pleasant surprise\fR. 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 ;) .PP Flattr , Gratipay , or indulge my Amazon Wishlist ... If and *only* if you so desire. .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2012 by Chris Weyl. .PP This is free software, licensed under: .PP .Vb 1 \& The GNU Lesser General Public License, Version 2.1, February 1999 .Ve