From: Dave Rolsky Date: Wed, 25 Mar 2009 22:21:47 +0000 (-0500) Subject: Docs for MM::TC::Role X-Git-Tag: 0.72_01~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3cb26ff41126204bfadbbae72f0bb0def9c7dbac;p=gitmo%2FMoose.git Docs for MM::TC::Role --- diff --git a/lib/Moose/Meta/TypeConstraint/Role.pm b/lib/Moose/Meta/TypeConstraint/Role.pm index 5e404b7..3262bf7 100644 --- a/lib/Moose/Meta/TypeConstraint/Role.pm +++ b/lib/Moose/Meta/TypeConstraint/Role.pm @@ -110,31 +110,56 @@ __END__ Moose::Meta::TypeConstraint::Role - Role/TypeConstraint parallel hierarchy +=head1 DESCRIPTION + +This class represents type constraints for a role. + +=head1 INHERITANCE + +C is a subclass of +L. + =head1 METHODS =over 4 -=item B +=item B<< Moose::Meta::TypeConstraint::Role->new(%options) >> + +This creates a new role type constraint based on the given +C<%options>. + +It takes the same options as its parent, with two exceptions. First, +it requires an additional option, C, which is name of the +constraint's role. Second, it automatically sets the parent to the +C type. + +The constructor also overrides the hand optimized type constraint with +one it creates internally. -=item B +=item B<< $constraint->role >> -=item B +Returns the role name associated with the constraint. -=item B +=item B<< $constraint->parents >> -=item B +Returns all the type's parent types, corresponding to the roles that +its role does. -=item B +=item B<< $constraint->is_a_subtype_of($type_name_or_object) >> -=item B +If the given type is also a role type, then this checks that the +type's role does the other type's role. -=item B +Otherwise it falls back to the implementation in +L. -=item B +=item B<< $constraint->create_child_type(%options) >> -Return all the parent types, corresponding to the parent classes. +This returns a new L object with the type +as its parent. -=item B +Note that it does I return a C +object! =back