From: Aankhen Date: Tue, 1 May 2007 03:22:31 +0000 (+0000) Subject: Moose::Util::TypeConstraints: X-Git-Tag: 0_21~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=429ccc11995704051866f5b7b4ce29f67376d424;p=gitmo%2FMoose.git Moose::Util::TypeConstraints: * fixed typo in sub name: export_type_contstraints_as_functions -> export_type_constraints_as_functions (added alias to old name). * updated POD. --- diff --git a/lib/Moose/Util/TypeConstraints.pm b/lib/Moose/Util/TypeConstraints.pm index 6d486dd..7fed316 100644 --- a/lib/Moose/Util/TypeConstraints.pm +++ b/lib/Moose/Util/TypeConstraints.pm @@ -112,13 +112,15 @@ sub unimport { ); } - sub export_type_contstraints_as_functions { + sub export_type_constraints_as_functions { my $pkg = caller(); no strict 'refs'; foreach my $constraint (keys %TYPES) { *{"${pkg}::${constraint}"} = find_type_constraint($constraint)->_compiled_type_constraint; } - } + } + + *Moose::Util::TypeConstraints::export_type_contstraints_as_functions = \&export_type_constraints_as_functions; sub list_all_type_constraints { keys %TYPES } } @@ -378,12 +380,16 @@ meta-object. What you do with it from there is up to you :) Given a list of C<@type_constraint_names>, this will return a B instance. -=item B +=item B This will export all the current type constraints as functions into the caller's namespace. Right now, this is mostly used for testing, but it might prove useful to others. +=item B + +Alias for the above function. + =item B This will return a list of type constraint names, you can then