[Moose-commits] r7656 - Moose/trunk/lib/Moose/Util

autarch at code2.0beta.co.uk autarch at code2.0beta.co.uk
Fri Feb 13 19:28:58 GMT 2009


Author: autarch
Date: 2009-02-13 11:28:58 -0800 (Fri, 13 Feb 2009)
New Revision: 7656

Modified:
   Moose/trunk/lib/Moose/Util/TypeConstraints.pm
Log:
Add RoleName to docs and clarify RoleName vs Role. Also clarify what
class_type and role_type do.


Modified: Moose/trunk/lib/Moose/Util/TypeConstraints.pm
===================================================================
--- Moose/trunk/lib/Moose/Util/TypeConstraints.pm	2009-02-13 19:18:40 UTC (rev 7655)
+++ Moose/trunk/lib/Moose/Util/TypeConstraints.pm	2009-02-13 19:28:58 UTC (rev 7656)
@@ -759,6 +759,7 @@
                 Int
               Str
                 ClassName
+                RoleName
           Ref
               ScalarRef
               ArrayRef[`a]
@@ -794,6 +795,10 @@
 this type constraint to pass. I know this is not ideal for all,
 but it is a saner restriction than most others.
 
+B<NOTE:> The C<RoleName> constraint checks a string is I<package name>
+which is a role, like C<'MyApp::Role::Comparable'>. The C<Role>
+constraint checks that an I<object> does the named role.
+
 =head2 Type Constraint Naming
 
 Type name declared via this module can only contain alphanumeric
@@ -870,13 +875,13 @@
 
 =item B<class_type ($class, ?$options)>
 
-Creates a type constraint with the name C<$class> and the metaclass
-L<Moose::Meta::TypeConstraint::Class>.
+Creates a new subtype of C<Object> with the name C<$class> and the
+metaclass L<Moose::Meta::TypeConstraint::Class>.
 
 =item B<role_type ($role, ?$options)>
 
-Creates a type constraint with the name C<$role> and the metaclass
-L<Moose::Meta::TypeConstraint::Role>.
+Creates a C<Role> type constraint with the name C<$role> and the
+metaclass L<Moose::Meta::TypeConstraint::Role>.
 
 =item B<maybe_type ($type)>
 




More information about the Moose-commits mailing list