MooseX...bleHash(3pm)

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

πŸ’– MooseX::AttributeHelpers::Collection::ImmutableHash πŸ’–

okay bestie, so this page lives in the MooseX...bleHash(3pm) spot in your manual β€” yes the name got chopped by the terminal, it's giving "my name is too long for the header" energy, but it's literally MooseX::AttributeHelpers::Collection::ImmutableHash and it's the immutable HashRef attribute type. no cap.

version 0.25 btw πŸŽ€


✨ SYNOPSIS ✨

like, here's the whole vibe in code, copy it exactly fr fr:

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

has 'options' => (
    metaclass => 'Collection::ImmutableHash',
    is        => 'ro',
    isa       => 'HashRef[Str]',
    default   => sub { {} },
    provides  => {
        'get'    => 'get_option',
        'empty'  => 'has_options',
        'keys'   => 'get_option_list',
    }
);

look at her. she's ro, she's got a HashRef[Str], she's handing out named methods like candy. main character energy πŸ’…


🌸 DESCRIPTION 🌸

so what this module does is hand you an immutable HashRef attribute β€” like, once it exists, that's it, no take-backs β€” and it comes with a whole little squad of hash-line operations you can call on it. it's giving "look but don't touch" but make it useful πŸ¦‹

and if you wanna know the deets on all those operations, the way that you do that is you go read MooseX::AttributeHelpers::MethodProvider::ImmutableHash. she has the full breakdown. iykyk πŸ’œ


🧚 METHODS 🧚

the whole roster, no skipping, every single one:

  • meta β€” the meta, as one does
  • method_provider β€” the thing that provides the methods
  • has_method_provider β€” checks whether it has a method provider
  • helper_type β€” the helper type

periodt. that's the list 🌈


🫢 SUPPORT 🫢

got bugs? we love a bug report (affectionate). you can submit them through the RT bug tracker at https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-AttributeHelpers β€” and yeah the URL wraps weird in the original, that's just how it do β€” or you can email bug-MooseX-AttributeHelpers@rt.cpan.org. either way, we got you πŸ’–

there's also a mailing list for users of this distribution, over at http://lists.perl.org/list/moose.html. come thru ✨

and there's an irc channel for users of this distribution too β€” #moose on irc.perl.org, aka irc://irc.perl.org/#moose. hop in, say hi, it's a whole vibe πŸŽ€


πŸ‘‘ AUTHOR πŸ‘‘

Stevan Little <stevan@iinteractive.com> β€” the icon, the legend, the moment. we stan 🫢


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. slay πŸ’…


just a lil reminder bestie: the "immutable" in the name is not a suggestion, it's the whole point. don't be out here trying to mutate her πŸ™ˆ

and that's the page!! this was perl v5.34.0, dated 2022-06-15, and the manual name is MooseX...bleHash(3pm) because the header ran out of room for the full glow-up. love that for us. mwah πŸ’‹

πŸ“¦ where this page comes from