Moose::...DuckType(3)
β¨ NAME β¨
Moose::Meta::TypeConstraint::DuckType β the type constraint for duck typing, bestie π
(also filed under Moose::...DuckType(3), if you were squinting at the manual name wondering what the ellipsis was about π¦)
πΈ VERSION πΈ
version 2.4000
π DESCRIPTION π
okay so picture this: this class represents type constraints that are built off an enumerated list of required methods. that's it, that's the whole vibe. if it quacks, it's a duck. no cap. π¦
π INHERITANCE π
Moose::Meta::TypeConstraint::DuckType is a subclass of Moose::Meta::TypeConstraint. it's giving family tree, it's giving legacy. π
π«Ά METHODS π«Ά
Moose::Meta::TypeConstraint::DuckType->new(%options)
this creates a new duck type constraint based on the %options you hand it. β¨
it takes the same options as its parent, with several exceptions, and like⦠the exceptions are the whole personality:
- First β it requires an extra option,
"methods". this one should be an array reference containing a list of required method names. you don't get to skip it, it's mandatory, it's the main character. π - Second β it automatically sets the parent to the
"Object"type. auto. no input needed, she did it herself. - Finally β it ignores any
"constraint"option you provide. like, fully ignores. the constraint is generated automatically based on the"methods"you provided. don't fight it. π
$constraint->methods
returns the array reference of required methods that got provided to the constructor. just hands it right back to you. π
$constraint->create_child_type
this returns a new Moose::Meta::TypeConstraint object with the type as its parent.
β οΈ NOT ME FORGETTING THIS PART: note that it does not return a "Moose::Meta::TypeConstraint::DuckType" object! read that again. it does not. it's a plain Moose::Meta::TypeConstraint. do not come for me when your duck turns into a regular object, the manpage literally told you. π
π BUGS π
See "BUGS" in Moose for details on reporting bugs. go snitch, bestie, they want to hear it. π£
π AUTHORS π
- 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>
a whole group chat of absolute legends fr fr πβ
π 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.
and that's the whole page, you ate that π this little icon dropped with perl v5.42.0 and it's dated 2025-07-25 β so if you're reading this on that date, happy release day, and if you're reading it way later, well, iconic things don't expire. π§β¨
π¦ 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