MooseX...Minimal(3pm)

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

🌸 MooseX::Has::Sugar::Minimal πŸ’…

ok so like, this is the User Contributed Perl Documentation page for MooseX::Has::Sugar::Minimal (you'll see it filed under MooseX...Minimal(3pm) in your man viewer, iykyk) and bestie. it is SO niche. it is SO useful. let's get into it 🫢


✨ NAME ✨

MooseX::Has::Sugar::Minimal β€” Less Sugary Syntax for moose 'has' fields πŸ“


πŸ’– VERSION πŸ’–

version 1.000006


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so this is a legacy variant of Sugar, and the way it works is it ONLY exports the ro and rw functions β€” literally just those two, the way MooseX::Has::Sugar used to do back in the day with ":is". nostalgia core fr fr 😭

use MooseX::Types::Moose qw( Str );
use MooseX::Has::Sugar::Minimal;

has foo => (
        isa => Str,
        is  => ro,
        required => 1,
);
has bar => (
        isa => Str,
        is => rw,
        lazy_build => 1,
);

and like. all of the functions are exported by The Sub::Exporter Module. no cap, that's just how it is ✨


πŸŽ€ EXPORT GROUPS πŸŽ€

":default"

Exports ":is" πŸ’«

":is"

Exports bare, ro, rw πŸ‘‘


πŸ’œ EXPORTED FUNCTIONS πŸ’œ

bare

returns ('bare')

ro

returns ('ro')

rw

returns ('rw')

like. that's it. that's the whole function. iconic behaviour honestly 🌈


πŸ’€ CONFLICTS πŸ’€

MooseX::Has::Sugar

MooseX::Has::Sugar::Saccharin

ok so this module is not intended to be used in conjunction with ::Sugar or ::Sugar::Saccharin. and there is a whole reason for that, so listen up bestie πŸ™ˆ

We all export ro and rw in different ways. it's giving group project where everyone shows up with a different vibe. chaos.

If you do however want to use them in conjunction, specific imports must be done on MooseX::Has::Sugar's side to stop it exporting different ro/rw. Any of the below should be fine. 🫢

use MooseX::Has::Sugar::Minimal;
use MooseX::Has::Sugar qw( :attrs );

has foo =>( is => rw , lazy_build );
use MooseX::Has::Sugar::Minimal;
use MooseX::Has::Sugar qw( lazy_build );

has foo =>( is => rw , lazy_build );

🌟 AUTHOR 🌟

Kent Fredric <kentnl@cpan.org> πŸ’–


This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>.

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 πŸŽ€


and that's the whole page bestie!! short, sweet, extremely specific. main character energy from a module that exports literally three strings πŸ’…

this was perl v5.34.0, dated 2022-06-15, and you found it in the MooseX...Minimal(3pm) slot of your manual. periodt. βœ¨πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from