MooseX...Object(3pm)
π MooseX::Types::Set::Object π
okay bestie, so this is a page from the User Contributed Perl Documentation manual, and it's literally all about MooseX::Types::Set::Object β a Set::Object type with coercions and stuff. yes, "and stuff" is in the official description, she's iconic like that. π
β¨ VERSION β¨
version 0.05 β that's the vibe check, we're on 0.05. π¦
πΈ SYNOPSIS πΈ
bestie just look at the code, it's giving main character energy:
package Foo;
use Moose;
use MooseX::Types::Set::Object;
has children => (
isa => "Set::Object",
accessor => "transition_set",
coerce => 1, # also accept array refs
handles => {
children => "members",
add_child => "insert",
remove_child => "remove",
# See Set::Object for all the methods you could delegate
},
);
# ...
my $foo = Foo->new( children => [ @objects ] );
$foo->add_child( $obj );
like. you set up an attribute, you coerce array refs in, you delegate a whole little squad of methods. periodt. π
π DESCRIPTION π
so this module hands you a Moose type constraint (peep Moose::Util::TypeConstraints and MooseX::Types for the lore).
β οΈ but here's the tea, and it's important tea: this constraint and its coercions are global. they are not just limited to the scope that imported them. so it's acting like a regular Moose type constraint, not like one of those MooseX::Types ones that stay in their lane. no cap. π«Ά
π§ TYPES π§
Set::Objectβ a subtype of"Object"that isaSet::Object, with coercions to and from the"ArrayRef"type. so it slides in both directions, slay. β¨
π SEE ALSO π
go read these too, they're the friends of the family:
Set::ObjectMooseX::AttributeHandlersMooseX::TypesMoose::Util::TypeConstraints
π AUTHOR π
XXXX XXX'XX (Yuval Kogman) <nothingmuch@woobling.org>
(the XXXX XXX'XX is literally in the original, we don't ask questions, we just respect the mystery π)
π©· CONTRIBUTORS π©·
Karen Etheridge <ether@cpan.org>Florian Ragwitz <rafl@debian.org>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2008 by Yuval Kogman.
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 go forth, remix, redistribute, it's free fr fr. π
π¦ a lil sign-off π¦
okay that's the whole page, you're all caught up bestie!! this one came from the Perl v5.34.0 docs, dated 2022-06-16, and it lives at MooseX...Object(3pm). mwah, go write some slay type constraints. π
πΈβ¨
π¦ where this page comes from
- debian bookworm: libmoosex-types-set-object-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoosex-types-set-object-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoosex-types-set-object-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-types-set-object-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-types-set-object-perl 0.05-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms