MooseX...orator(3pm)

πŸ’… MooseX::Types::TypeDecorator

ok so bestie, welcome to the MooseX::Types::TypeDecorator page from the User Contributed Perl Documentation β€” yes that's the manual name, we're in perl land now πŸͺ✨

🌸 VERSION

version 0.51 β€” that's the one, don't @ me.


πŸ¦‹ DESCRIPTION

So basically, this is a decorator object that holds an underlying type constraint inside it. Like it's literally wearing the type constraint as an outfit πŸ’…. We use it to control access to that type constraint and to sprinkle some extra features on top. Main character energy fr fr.


✨ METHODS

This class defines the following methods, and yes we're going through all of them πŸŽ€

πŸ’– new

Old school instantiation. That's it, that's the vibe. Classic, vintage, iconic.

πŸ’œ __type_constraint ($type_constraint)

Sets and/or gets the type_constraint. One method, two jobs, she's versatile like that 🫢

🌈 "isa"

This one handles $self->isa because AUTOLOAD literally can't β€” rip 😭. It tries both the type constraint, and for a class type, the class.

πŸ“ can

Handles $self->can since AUTOLOAD can't. Same struggle, same solution. No cap.

⭐ _throw_error

Properly delegates error messages. She's the messenger and she's not getting shot, ok? πŸ’€

🧚 DESTROY

We might need it later. That's the whole description. Leaving it there for future us πŸ‘‘.

πŸ”₯ AUTOLOAD

Okay this is the big one. It delegates to the decorator target, unless this is a class type β€” in which case it will try to delegate to the type object first, then if that fails, try the class.

⚠️ Heads up: the method 'new' is special cased to only be permitted on the class. So if there's no class, or the class doesn't provide a new method, an exception will be thrown. Periodt. Don't come for me when it throws.

πŸŽ€ SUPPORT

Got beef? Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Types> β€” or you can email bug-MooseX-Types@rt.cpan.org πŸ’Œ

There's also a mailing list for users of this distribution, hanging out at <http://lists.perl.org/list/moose.html>.

And there's an irc channel for users of this distribution too β€” #moose on irc.perl.org <irc://irc.perl.org/#moose>. Come say hi 🌸


πŸ‘‘ AUTHOR

Robert "phaylon" Sedlacek <rs@474.at> β€” a legend, we stan.


This software is copyright (c) 2007 by Robert "phaylon" Sedlacek.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Free as in, go off bestie πŸ¦‹


mkay that's the whole page!! this little writeup is perl v5.42.0, born 2025-07-25, and it's the MooseX::Types::TypeDecorator manual β€” catch you in the group chat πŸ’–βœ¨πŸ«Ά

πŸ“¦ where this page comes from