MooseX-Types
view release on metacpan or search on metacpan
lib/MooseX/Types/Combine.pm view on Meta::CPAN
#pod In this example all types defined in C<MotorizedTypes> and C<UnmotorizedTypes>
#pod are available through the C<TransportTypes> combined type library.
#pod
#pod package SkiingTrip;
#pod
#pod use Moose;
#pod
#pod use TransportTypes qw( CarType SkisType );
#pod
#pod has car => ( is => 'ro', isa => CarType, required => 1 );
#pod has ski_rack => ( is => 'ro', isa => ArrayRef[SkisType], required => 1 );
#pod ...
#pod
#pod Libraries on the right end of the list passed to L</provide_types_from> take
#pod precedence over those on the left in case of conflicts. So, in the above
#pod example if both the C<MotorizedTypes> and C<UnmotorizedTypes> libraries provided
#pod a C<Bike> type, you'd get the bicycle from C<UnmotorizedTypes> not the
#pod motorbike from C<MorotizedTypes>.
#pod
#pod You can also further combine combined type libraries with additional type
#pod libraries or other combined type libraries in the same way to provide even
lib/MooseX/Types/Combine.pm view on Meta::CPAN
In this example all types defined in C<MotorizedTypes> and C<UnmotorizedTypes>
are available through the C<TransportTypes> combined type library.
package SkiingTrip;
use Moose;
use TransportTypes qw( CarType SkisType );
has car => ( is => 'ro', isa => CarType, required => 1 );
has ski_rack => ( is => 'ro', isa => ArrayRef[SkisType], required => 1 );
...
Libraries on the right end of the list passed to L</provide_types_from> take
precedence over those on the left in case of conflicts. So, in the above
example if both the C<MotorizedTypes> and C<UnmotorizedTypes> libraries provided
a C<Bike> type, you'd get the bicycle from C<UnmotorizedTypes> not the
motorbike from C<MorotizedTypes>.
You can also further combine combined type libraries with additional type
libraries or other combined type libraries in the same way to provide even
( run in 1.180 second using v1.01-cache-2.11-cpan-39bf76dae61 )