X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FTypeConstraint%2FRole.pm;h=00b60aca3c442b9969cc94b9aa5e0b85a8eba10d;hb=1d9c3b758874ac9ecd67ddf4a79621af543434ce;hp=cbda63dc2ee2d9c83a9bc6727f84bb4fc78f9dce;hpb=a7be0f8593e4e7b7f570f49027ee4f8f25d4d8bc;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/TypeConstraint/Role.pm b/lib/Moose/Meta/TypeConstraint/Role.pm index cbda63d..00b60ac 100644 --- a/lib/Moose/Meta/TypeConstraint/Role.pm +++ b/lib/Moose/Meta/TypeConstraint/Role.pm @@ -7,7 +7,7 @@ use metaclass; use Scalar::Util 'blessed'; use Moose::Util::TypeConstraints (); -our $VERSION = '0.69'; +our $VERSION = '0.73'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -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_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