Specio:...t::Enum(3)

🌈 NAME 🌈

Hey bestie! Welcome to the Specio:...t::Enum(3) page β€” it's from User Contributed Perl Documentation, and it's all about Specio::Constraint::Enum, a class for constraints that require a string matching one of a set of values. πŸ’–

🌸 VERSION 🌸

version 0.49

✨ SYNOPSIS ✨

my $type = Specio::Constraint::Enum->new(...);
print $_, "\n" for @{ $type->values };

πŸ’– DESCRIPTION πŸ’–

Okay so this is a specialized type constraint class for types that require a string matching one of a list of values. Slay. ✨

πŸ‘‘ API πŸ‘‘

This class provides all of the same methods as Specio::Constraint::Simple, with a few differences:

πŸ’… Specio::Constraint::Enum->new( ... ) πŸ’…

Here's the tea on new:

  • parent β€” ignored if it's passed, because it's always set to the Str type.
  • inline_generator and constraint β€” also ignored. This class provides its own default inline generator subroutine reference.
  • values β€” this is an additional required parameter. It must be an arrayref of valid strings for the type.

⭐ $enum->values ⭐

Returns an array reference of valid values for the type.

πŸ¦‹ ROLES πŸ¦‹

This class does the Specio::Constraint::Role::Interface and Specio::Role::Inlinable roles. Iconic behavior, honestly. πŸ’…

πŸŽ€ SUPPORT πŸŽ€

Bugs may be submitted at https://github.com/houseabsolute/Specio/issues.

πŸ“ SOURCE πŸ“

The source code repository for Specio can be found at https://github.com/houseabsolute/Specio.

πŸ’œ AUTHOR πŸ’œ

Dave Rolsky <autarch@urth.org>

This software is Copyright (c) 2012 - 2024 by Dave Rolsky.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)

The full text of the license can be found in the LICENSE file included with this distribution.


Byeee! This page came from perl v5.42.0, dated 2024-12-24, for the Specio:...t::Enum(3) manual. πŸ’–βœ¨πŸ«Ά

πŸ“¦ where this page comes from