From: Stevan Little Date: Sat, 17 Mar 2007 16:42:31 +0000 (+0000) Subject: for mst and phaylon X-Git-Tag: 0_19~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=943596a66bcf7cb7bd085fc67545e9f227028dd3;p=gitmo%2FMoose.git for mst and phaylon --- diff --git a/Changes b/Changes index 9c356a7..731e8f1 100644 --- a/Changes +++ b/Changes @@ -5,6 +5,9 @@ Revision history for Perl extension Moose - type now supports messages as well (thanks to phaylon for finding this) - added tests for this + - added list_all_type_constraints and + list_all_builtin_type_constraints + functions to facilitate introspection. 0.18 Sat. March 10, 2007 ~~ Many, many documentation updates ~~ diff --git a/lib/Moose/Util/TypeConstraints.pm b/lib/Moose/Util/TypeConstraints.pm index 0c1270f..583861f 100644 --- a/lib/Moose/Util/TypeConstraints.pm +++ b/lib/Moose/Util/TypeConstraints.pm @@ -220,6 +220,11 @@ subtype 'Role' => where { $_->can('does') } => optimize_as { blessed($_[0]) && $_[0]->can('does') }; +{ + my @BUILTINS = list_all_type_constraints(); + sub list_all_builtin_type_constraints { @BUILTINS } +} + 1; __END__ @@ -381,6 +386,12 @@ This will return a list of type constraint names, you can then fetch them using C if you want to. +=item B + +This will return a list of builtin type constraints, meaning, +those which are defined in this module. See the section +labeled L for a complete list. + =back =head2 Type Constraint Constructors