From: Dave Rolsky Date: Wed, 25 Mar 2009 22:19:32 +0000 (-0500) Subject: Docs for MM::TC::Enum X-Git-Tag: 0.72_01~19 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d7d8f2eed4661bacfe2b2b4544ddb40db84a6c1a;p=gitmo%2FMoose.git Docs for MM::TC::Enum --- diff --git a/lib/Moose/Meta/TypeConstraint/Enum.pm b/lib/Moose/Meta/TypeConstraint/Enum.pm index e760396..c6b1ee7 100644 --- a/lib/Moose/Meta/TypeConstraint/Enum.pm +++ b/lib/Moose/Meta/TypeConstraint/Enum.pm @@ -82,21 +82,45 @@ __END__ Moose::Meta::TypeConstraint::Enum - Type constraint for enumerated values. +=head1 DESCRIPTION + +This class represents type constraints based on an enumerated list of +acceptable values. + +=head1 INHERITANCE + +C is a subclass of +L. + =head1 METHODS =over 4 -=item B +=item B<< Moose::Meta::TypeConstraint::Enum->new(%options) >> + +This creates a new class type constraint based on the given +C<%options>. + +It takes the same options as its parent, with several +exceptions. First, it requires an additional option, C. This +should be an array reference containing a list of valid string +values. Second, it automatically sets the parent to the C type. + +Finally, it ignores any provided C option. The constraint +is generated automatically based on the provided C -=item B +=item B<< $constraint->values >> -=item B +Returns the array reference of acceptable values provided to the +constructor. -=item B +=item B<< $constraint->create_child_type >> -=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