From: Dave Rolsky Date: Wed, 25 Mar 2009 22:16:16 +0000 (-0500) Subject: docs for MM::TC::Class X-Git-Tag: 0.72_01~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f4bf6b8f5ba835bb47a9ecf04fab9ab39fad6f0;p=gitmo%2FMoose.git docs for MM::TC::Class --- diff --git a/lib/Moose/Meta/TypeConstraint/Class.pm b/lib/Moose/Meta/TypeConstraint/Class.pm index ed4d8cb..433daa5 100644 --- a/lib/Moose/Meta/TypeConstraint/Class.pm +++ b/lib/Moose/Meta/TypeConstraint/Class.pm @@ -116,31 +116,56 @@ __END__ Moose::Meta::TypeConstraint::Class - Class/TypeConstraint parallel hierarchy +=head1 DESCRIPTION + +This class represents type constraints for a class. + +=head1 INHERITANCE + +C is a subclass of +L. + =head1 METHODS =over 4 -=item B +=item B<< Moose::Meta::TypeConstraint::Class->new(%options) >> + +This creates a new class 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 class. 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->class >> -=item B +Returns the class name associated with the constraint. -=item B +=item B<< $constraint->parents >> -=item B +Returns all the type's parent types, corresponding to its parent +classes. -=item B +=item B<< $constraint->is_a_subtype_of($type_name_or_object) >> -=item B +If the given type is also a class type, then this checks that the +type's class is a subclass of the other type's class. -=item B +Otherwise it falls back to the implement in +L. -Return all the parent types, corresponding to the parent classes. +=item B<< $constraint->create_child_type(%options) >> -=item B +This returns a new L object with the type +as its parent. -=item B +Note that it does I return a +C object! =back