Moose::...nt::Enum(3)

πŸ’– Moose::Meta::TypeConstraint::Enum πŸ’–

okay bestie, gather round, because this is the enum type constraint page from the Moose docs (User Contributed Perl Documentation, if we're being formal, which we are not) πŸŽ€


✨ NAME ✨

Moose::Meta::TypeConstraint::Enum β€” it's the type constraint for enumerated values, aka "pick one from this list or perish" πŸ’…


🌸 VERSION 🌸

version 2.4000 β€” yes she's got a version, she's a whole package πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

So basically this class represents type constraints that are built off an enumerated list of acceptable values. Like, you give it a list, and it's like "cool, those are the only options, we don't do surprises here." periodt ✨


πŸ‘‘ INHERITANCE πŸ‘‘

Moose::Meta::TypeConstraint::Enum is a subclass of Moose::Meta::TypeConstraint. It's giving nepo baby but in a cute, structural way 🫢


πŸ’œ METHODS πŸ’œ

🌈 Moose::Meta::TypeConstraint::Enum->new(%options)

This creates a new enum type constraint based on the given %options. new day, new constraint, iconic πŸ’…

It takes the same options as its parent, with several exceptions:

  1. It requires an additional option, values. This should be an array reference containing a list of valid string values. Not optional. She needs the list, bestie πŸ“‹
  2. It automatically sets the parent to the Str type. no need to do it yourself, she's got you 🌸
  3. It ignores any provided constraint option. The constraint is generated automatically based on the provided values. So like, don't even try to hand her a constraint, she's building her own ✨

🌈 $constraint->values

Returns the array reference of acceptable values provided to the constructor. It's the receipts, the list, the whole vibe check πŸŽ€

🌈 $constraint->create_child_type

This returns a new Moose::Meta::TypeConstraint object with the type as its parent.

⚠️ note that it does not return a Moose::Meta::TypeConstraint::Enum object! the way that it's a whole different class... do not get it twisted, bestie 😭

πŸ’€ BUGS πŸ’€

See "BUGS" in Moose for details on reporting bugs. go tell the Moose folks, they'll handle it 🫢


πŸŽ€ AUTHORS πŸŽ€

these are the legends, the main characters, the ones who built this:

  • Stevan Little <stevan@cpan.org> πŸ‘‘
  • Dave Rolsky <autarch@urth.org> πŸ‘‘
  • Jesse Luehrs <doy@cpan.org> πŸ‘‘
  • Shawn M Moore <sartak@cpan.org> πŸ‘‘
  • Χ™Χ•Χ‘Χœ Χ§Χ•Χ’'מן (Yuval Kogman) <nothingmuch@woobling.org> πŸ‘‘
  • Karen Etheridge <ether@cpan.org> πŸ‘‘
  • Florian Ragwitz <rafl@debian.org> πŸ‘‘
  • Hans Dieter Pearcey <hdp@cpan.org> πŸ‘‘
  • Chris Prather <chris@prather.org> πŸ‘‘
  • Matt S Trout <mstrout@cpan.org> πŸ‘‘

ate and left no crumbs, fr fr πŸ’–


This software is copyright (c) 2006 by Infinity Interactive, Inc.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go forth and remix, responsibly 🧚


and that's the whole page, bestie!! ✨ this cutie was rendered by perl v5.42.0 on 2025-07-25, and it lives under Moose::...nt::Enum(3) in the User Contributed Perl Documentation set β€” mwah, love that for her πŸ’‹πŸ’–

πŸ“¦ where this page comes from