Moose::...::Class(3)
π NAME π
Moose::Meta::TypeConstraint::Class β it's giving class/TypeConstraint parallel hierarchy, bestie. This is the page from User Contributed Perl Documentation, and honestly? She ate. β¨
πΈ VERSION πΈ
version 2.4000 β yes she's got a version number, she's official, she has a whole identity π«Ά
π¦ DESCRIPTION π¦
Okay so. This class represents type constraints for a class. That's it, that's the whole vibe. A class constraint. Very demure, very mindful, very "is this thing actually a Foo or not". π
π INHERITANCE π
Moose::Meta::TypeConstraint::Class is a subclass of Moose::Meta::TypeConstraint. So she got it from her mama, as she should. π
β¨ METHODS β¨
π Moose::Meta::TypeConstraint::Class->new(%options)
This creates a new class type constraint based on the given %options. Slay.
It takes the same options as its parent, with two exceptions, and bestie these exceptions matter:
- First, it requires an additional option,
class, which is the name of the constraint's class. Like you have to pass it, no skipping. - Second, it automatically sets the parent to the
Objecttype. Not you, her. She does it herself. Main character energy. π
The constructor also overrides the hand optimized type constraint with one it creates internally. Yeah. She said "I'll handle that one myself, thanks." π
π§ $constraint->class
Returns the class name associated with the constraint. Literally just tells you which class. Simple. Iconic. No notes. π
πΈ $constraint->parents
Returns all the type's parent types, corresponding to its parent classes. Family tree reveal, but make it types. π³β¨
π $constraint->is_subtype_of($type_name_or_object)
If the given type is also a class type, then this checks that the type's class is a subclass of the other type's class. Classic "is she related to her" check.
Otherwise it falls back to the implementation in Moose::Meta::TypeConstraint. So when it can't do the class-to-class thing, it just hands it over to the parent like "you take this one." π
β $constraint->create_child_type(%options)
This returns a new Moose::Meta::TypeConstraint object with the type as its parent.
β οΈ Note that it does not return a Moose::Meta::TypeConstraint::Class object! Read that again bestie, it's a whole different class. Not the class-y one. The plain one. Do not get caught lacking. π
π $constraint->get_message($value)
This is the same as "get_message" in Moose::Meta::TypeConstraint except that it explicitly says "isa" was checked. Why, you ask? To help users deal with accidentally autovivified type constraints. Yeah. Autovivification strikes again. It always does. π
π BUGS π
See "BUGS" in Moose for details on reporting bugs. Go tell the Moose people, not this page. π«Ά
π«Ά AUTHORS π«Ά
Look at this roster, it's a whole squad, a friend group of absolute legends:
- 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>
Ten whole icons. We love to see it. π
π COPYRIGHT AND LICENSE π
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 wild, respectfully. π
and that's the whole page bestie β¨ she's documented, she's version 2.4000, she's running on perl v5.42.0 and this lil writeup is dated 2025-07-25 β periodt, no cap, go build something cute ππ
π¦ where this page comes from
- fedora 43: perl-Moose 2.4000-4.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms