MooseX...Object(3pm)

πŸ“¦
version 0.05 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 isa Set::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::Object
  • MooseX::AttributeHandlers
  • MooseX::Types
  • Moose::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 🩷

  1. Karen Etheridge <ether@cpan.org>
  2. Florian Ragwitz <rafl@debian.org>

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