MooseX...uteTags(3pm)
π MooseX::AttributeTags π
okay so bestie, welcome to the User Contributed Perl Documentation for section 3pm β this is MooseX::AttributeTags, and it's literally just "tag your Moose attributes." that's the whole name. that's the whole vibe. π
β¨ NAME β¨
MooseX::AttributeTags β tag your Moose attributes. slay. π
π¦ SYNOPSIS π¦
okay watch this, it's giving main character energy:
package User;
use Moose;
use MooseX::Types::Moose 'Bool';
use MooseX::AttributeTags (
SerializationStyle => [
hidden => Bool,
],
);
has username => (
traits => [ SerializationStyle ],
is => 'ro',
hidden => 0,
);
has password => (
traits => [ SerializationStyle ],
is => 'rw',
hidden => 1,
);
see how hidden is just... there? like it always belonged? that's the whole point bestie. πβ¨
πΈ DESCRIPTION πΈ
so MooseX::AttributeTags is a factory for attribute traits. that's it, that's the job. and the way that literally all the work happens inside the import method?? obsessed. no cap. π«Ά
π Methods π
import(@optlist)
okay so the option list is just a list of trait names to create β and those get exported to the caller package as constants. cute, right? β
each trait name can optionally be followed by an arrayref of attributes to be created inside that trait. (in the SYNOPSIS up there, the SerializationStyle trait gets an attribute called hidden β she's shy, she's iconic. π)
and then, each of those attributes can optionally be followed by one of these three besties:
- A coderef which provides a default value for the attribute. π
- A type constraint object (like the ones from
Types::StandardorMooseX::Typesβ not a type constraint string, ok?? like actually not) to validate the attribute. - An arrayref or hashref providing options similar to those you'd hand to Moose's
haskeyword.
and btw? in that SYNOPSIS example, a constant called User::SerializationStyle gets defined. yes really. π«
my $attr = User->meta->get_attribute('username');
$attr->does(User::SerializationStyle); # true
$attr->hidden; # false
look at her go. does says true, hidden says false. fr fr. π₯
π BUGS π
not me having to tell you this π β please report any bugs to <http://rt.cpan.org/Dist/Display.html?Queue=MooseX-AttributeTags>.
no like actually report them bestie, don't just vibe about it in the group chat. π«Ά
π SEE ALSO π
Moose.
that's it. one (1) whole friend. quality over quantity. π
π AUTHOR π
Toby Inkster <tobyink@cpan.org>. iconic behavior, honestly. π
π COPYRIGHT AND LICENCE π
This software is copyright (c) 2013, 2017, 2019 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. β¨
π§ DISCLAIMER OF WARRANTIES π§
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
read that again. no warranty bestie. none. zero. zip. nada. π
and that's the whole page!! π¦ this was generated from perl v5.32.1, dated 2021-09-12, and yeah the doc title is literally MooseX...uteTags(3pm) β she got cut off mid-name and honestly?? relatable. π
bye bestie, go tag some attributes!! πβ¨
π¦ where this page comes from
- debian bookworm: libmoosex-attributetags-perl 0.005-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoosex-attributetags-perl 0.005-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libmoosex-attributetags-perl 0.005-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoosex-attributetags-perl 0.005-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-attributetags-perl 0.005-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-attributetags-perl 0.005-1 Β· 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