.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.48) .\" .\" 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 .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . 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 .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "MooseX::Types::Combine 3" .TH MooseX::Types::Combine 3 2026-10-25 "perl v5.44.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 SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& package CombinedTypeLib; \& \& use base \*(AqMooseX::Types::Combine\*(Aq; \& \& _\|_PACKAGE_\|_\->provide_types_from(qw/TypeLib1 TypeLib2/); \& \& package UserClass; \& \& use CombinedTypeLib qw/Type1 Type2 ... /; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Allows you to create a single class that will allow you to export types from multiple type libraries: .PP .Vb 1 \& package TransportTypes; \& \& use base \*(AqMooseX::Types::Combine\*(Aq; \& \& _\|_PACKAGE_\|_\->provide_types_from(qw/ MotorizedTypes UnmotorizedTypes /); \& \& 1; .Ve .PP In this example all types defined in \f(CW\*(C`MotorizedTypes\*(C'\fR and \f(CW\*(C`UnmotorizedTypes\*(C'\fR are available through the \f(CW\*(C`TransportTypes\*(C'\fR combined type library. .PP .Vb 1 \& package SkiingTrip; \& \& use Moose; \& \& use TransportTypes qw( CarType SkisType ); \& \& has car => ( is => \*(Aqro\*(Aq, isa => CarType, required => 1 ); \& has ski_rack => ( is => \*(Aqro\*(Aq, isa => ArrayRef[SkisType], required => 1 ); \& ... .Ve .PP Libraries on the right end of the list passed to "provide_types_from" take precedence over those on the left in case of conflicts. So, in the above example if both the \f(CW\*(C`MotorizedTypes\*(C'\fR and \f(CW\*(C`UnmotorizedTypes\*(C'\fR libraries provided a \f(CW\*(C`Bike\*(C'\fR type, you\*(Aqd get the bicycle from \f(CW\*(C`UnmotorizedTypes\*(C'\fR not the motorbike from \f(CW\*(C`MorotizedTypes\*(C'\fR. .PP You can also further combine combined type libraries with additional type libraries or other combined type libraries in the same way to provide even larger type libraries: .PP .Vb 1 \& package MeetingTransportTypes; \& \& use base \*(AqMooseX::Types::Combine\*(Aq; \& \& _\|_PACKAGE_\|_\->provide_types_from(qw/ TransportTypes TelepresenceTypes /); \& \& 1; .Ve .SH "CLASS METHODS" .IX Header "CLASS METHODS" .SS provide_types_from .IX Subsection "provide_types_from" Sets or returns a list of type libraries (or combined type libraries) to re\-export from. .SS type_names .IX Subsection "type_names" Returns a list of all known types by their name. .SH "SEE ALSO" .IX Header "SEE ALSO" MooseX::Types