package MooseX::Types::Base;
use Moose;
-=head1 NAME
-
-MooseX::Types::Base - Type library base class
-
-=cut
+# ABSTRACT: Type library base class
use Carp::Clan qw( ^MooseX::Types );
use MooseX::Types::Util qw( filter_tags );
use Sub::Exporter qw( build_exporter );
use Moose::Util::TypeConstraints;
-use namespace::clean -except => [qw( meta )];
+use namespace::autoclean;
=head1 DESCRIPTION
You normally won't need to interact with this class by yourself. It is
-merely a collection of functionality that type libraries need to
+merely a collection of functionality that type libraries need to
interact with moose and the rest of the L<MooseX::Types> module.
=cut
=head2 import
-Provides the import mechanism for your library. See
+Provides the import mechanism for your library. See
L<MooseX::Types/"LIBRARY USAGE"> for syntax details on this.
=cut
# determine the wrapper, -into is supported for compatibility reasons
my $wrapper = $options->{ -wrapper } || 'MooseX::Types';
- $args[0]->{into} = $options->{ -into }
+ $args[0]->{into} = $options->{ -into }
if exists $options->{ -into };
my (%ex_spec, %ex_util);
my $undef_msg = sprintf($UndefMsg, $type_short, $class);
# the type itself
- push @{ $ex_spec{exports} },
+ push @{ $ex_spec{exports} },
$type_short,
- sub {
+ sub {
bless $wrapper->type_export_generator($type_short, $type_full),
'MooseX::Types::EXPORTED_TYPE_CONSTRAINT';
};
# create S:E exporter and increase export level unless specified explicitly
my $exporter = build_exporter \%ex_spec;
- $options->{into_level}++
+ $options->{into_level}++
unless $options->{into};
# remember requested symbols to determine what helpers to auto-export
- my %was_requested =
- map { ($_ => 1) }
- grep { not ref }
+ my %was_requested =
+ map { ($_ => 1) }
+ grep { not ref }
@args;
# determine which additional symbols (helpers) to export along
L<MooseX::Types::Moose>
-=head1 AUTHOR AND COPYRIGHT
-
-Robert 'phaylon' Sedlacek C<E<lt>rs@474.atE<gt>>, with many thanks to
-the C<#moose> cabal on C<irc.perl.org>.
-
=head1 LICENSE
This program is free software; you can redistribute it and/or modify