MooseX...:Array(3pm)

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

✨ MooseX::AttributeHelpers::Trait::Collection::Array β€” Array attribute ✨

okay bestie, pull up a chair 🫢 this is a page from the User Contributed Perl Documentation and it's all about making your Moose attributes do array things. it's giving "let my object hold a whole lil list and let me poke at it" energy. version 0.25, no cap πŸ’…


🌸 SYNOPSIS 🌸

  package Stuff;
  use Moose;
  use MooseX::AttributeHelpers;

  has 'options' => (
      metaclass => 'Collection::Array',
      is        => 'ro',
      isa       => 'ArrayRef[Int]',
      default   => sub { [] },
      provides  => {
          'push' => 'add_options',
          'pop'  => 'remove_last_option',
      }
  );

look at that. metaclass => 'Collection::Array' and suddenly your options attribute is a whole array situation, and you're out here handing out named methods like add_options and remove_last_option like party favours πŸŽ€ iconic behaviour, honestly.


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, this module gives you an Array attribute that comes with a whole bunch of array operations baked right in. it's literally the "here's a list, go wild" trait.

if you want the full tea on which operations you get and how they behave, go read MooseX::AttributeHelpers::MethodProvider::Array β€” that's where the details live, bestie. this page is just the vibe check πŸ’–

πŸ‘‘ METHODS πŸ‘‘

these are the methods, and yes they're all here, we're not skipping a single one:

  • meta
  • method_provider
  • has_method_provider
  • helper_type

🌈 SUPPORT 🌈

got a bug? it happens to the best of us 😭 you can submit it through the RT bug tracker:

https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-AttributeHelpers

or, if you're feeling email-y about it:

bug-MooseX-AttributeHelpers@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 if you wanna chat live, there's an irc channel for users of this distribution too β€” it's #moose on irc.perl.org:

irc://irc.perl.org/#moose

come through, the moose people are lovely fr fr 🫢


πŸ’œ AUTHOR πŸ’œ

Stevan Little <stevan@iinteractive.com>


This software is copyright (c) 2007 by Stevan Little and 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, bestie πŸ’… this was perl v5.34.0, dated 2022-06-15, and yeah the manual title got a lil shortened to MooseX...:Array(3pm) in the footer but you know exactly what it is. slay, go build something with arrays in it βœ¨πŸ’–πŸ¦‹
πŸ“¦ where this page comes from