X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FTypeConstraint%2FEnum.pm;h=def1402d86e2a82dad775a415497be54fe25d0c9;hb=92d8204181e20d7b6a0144fca0a99095a7788ff4;hp=e935babe67816f140da87b23e845124d64249b02;hpb=b2ad68e3fbe4016e354980a636c1ed39e941162a;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/TypeConstraint/Enum.pm b/lib/Moose/Meta/TypeConstraint/Enum.pm index e935bab..def1402 100644 --- a/lib/Moose/Meta/TypeConstraint/Enum.pm +++ b/lib/Moose/Meta/TypeConstraint/Enum.pm @@ -6,7 +6,7 @@ use metaclass; use Moose::Util::TypeConstraints (); -our $VERSION = '0.67'; +our $VERSION = '0.87'; $VERSION = eval $VERSION; our $AUTHORITY = 'cpan:STEVAN'; @@ -82,27 +82,51 @@ __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 enum 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 =head1 BUGS -All complex software has bugs lurking in it, and this module is no +All complex software has bugs lurking in it, and this module is no exception. If you find a bug please either email me, or add the bug to cpan-RT.