1Moose::Meta::TypeConstrUasienrt:C:oEnnturmi(b3u)ted PerlMoDoosceu:m:eMnettaat:i:oTnypeConstraint::Enum(3)
2
3
4
6 Moose::Meta::TypeConstraint::Enum - Type constraint for enumerated
7 values.
8
10 This class represents type constraints based on an enumerated list of
11 acceptable values.
12
14 "Moose::Meta::TypeConstraint::Enum" is a subclass of
15 Moose::Meta::TypeConstraint.
16
18 Moose::Meta::TypeConstraint::Enum->new(%options)
19 This creates a new enum type constraint based on the given
20 %options.
21
22 It takes the same options as its parent, with several exceptions.
23 First, it requires an additional option, "values". This should be
24 an array reference containing a list of valid string values.
25 Second, it automatically sets the parent to the "Str" type.
26
27 Finally, it ignores any provided "constraint" option. The
28 constraint is generated automatically based on the provided
29 "values".
30
31 $constraint->values
32 Returns the array reference of acceptable values provided to the
33 constructor.
34
35 $constraint->create_child_type
36 This returns a new Moose::Meta::TypeConstraint object with the type
37 as its parent.
38
39 Note that it does not return a "Moose::Meta::TypeConstraint::Enum"
40 object!
41
43 See "BUGS" in Moose for details on reporting bugs.
44
46 Yuval Kogman <nothingmuch@cpan.org>
47
49 Copyright 2006-2010 by Infinity Interactive, Inc.
50
51 <http://www.iinteractive.com>
52
53 This library is free software; you can redistribute it and/or modify it
54 under the same terms as Perl itself.
55
56
57
58perl v5.12.2 2010-08-2M8oose::Meta::TypeConstraint::Enum(3)