3 MooseX::Types::Wrapper - Wrap exports from a library
7 package MooseX::Types::Wrapper;
11 use Carp::Clan qw( ^MooseX::Types );
14 use namespace::clean -except => [qw( meta )];
16 extends 'MooseX::Types';
20 See L<MooseX::Types/SYNOPSIS> for detailed usage.
29 my ($class, @args) = @_;
30 my %libraries = @args == 1 ? (Moose => $args[0]) : @args;
32 for my $l (keys %libraries) {
34 croak qq($class expects an array reference as import spec)
35 unless ref $libraries{ $l } eq 'ARRAY';
38 = ($l eq 'Moose' ? 'MooseX::Types::Moose' : $l );
39 Class::MOP::load_class($library_class);
41 $library_class->import({
42 -into => scalar(caller),
44 }, @{ $libraries{ $l } });
57 See L<MooseX::Types/AUTHOR>.
61 This program is free software; you can redistribute it and/or modify
62 it under the same terms as perl itself.