1Specio::Constraint::EnuUms(e3r)Contributed Perl DocumentSapteicoino::Constraint::Enum(3)
2
3
4
6 Specio::Constraint::Enum - A class for constraints which require a
7 string matching one of a set of values
8
10 version 0.48
11
13 my $type = Specio::Constraint::Enum->new(...);
14 print $_, "\n" for @{ $type->values };
15
17 This is a specialized type constraint class for types which require a
18 string that matches one of a list of values.
19
21 This class provides all of the same methods as
22 Specio::Constraint::Simple, with a few differences:
23
24 Specio::Constraint::Enum->new( ... )
25 The "parent" parameter is ignored if it passed, as it is always set to
26 the "Str" type.
27
28 The "inline_generator" and "constraint" parameters are also ignored.
29 This class provides its own default inline generator subroutine
30 reference.
31
32 Finally, this class requires an additional parameter, "values". This
33 must be a an arrayref of valid strings for the type.
34
35 $enum->values
36 Returns an array reference of valid values for the type.
37
39 This class does the Specio::Constraint::Role::Interface and
40 Specio::Role::Inlinable roles.
41
43 Bugs may be submitted at
44 <https://github.com/houseabsolute/Specio/issues>.
45
47 The source code repository for Specio can be found at
48 <https://github.com/houseabsolute/Specio>.
49
51 Dave Rolsky <autarch@urth.org>
52
54 This software is Copyright (c) 2012 - 2022 by Dave Rolsky.
55
56 This is free software, licensed under:
57
58 The Artistic License 2.0 (GPL Compatible)
59
60 The full text of the license can be found in the LICENSE file included
61 with this distribution.
62
63
64
65perl v5.36.0 2022-07-22 Specio::Constraint::Enum(3)