MooseX...Number(3pm)
okay bestie, pull up a chair ๐ซถ this is the manual page for MooseX::AttributeHelpers::Number, straight out of the User Contributed Perl Documentation collection. It's short, it's sweet, it does math, and honestly? It ate. Let's go. โจ
๐ธ NAME ๐ธ
MooseX::AttributeHelpers::Number โ numerical attribute type. That's it, that's the whole vibe. ๐
๐ VERSION ๐
version 0.25 โ yes queen, we're on 0.25, no cap.
โจ SYNOPSIS โจ
Here's the whole thing in action, bestie. Copy it, it's perfect, it's iconic:
package Real;
use Moose;
use MooseX::AttributeHelpers;
has 'integer' => (
metaclass => 'Number',
is => 'ro',
isa => 'Int',
default => sub { 5 },
provides => {
set => 'set',
add => 'add',
sub => 'sub',
mul => 'mul',
div => 'div',
mod => 'mod',
abs => 'abs',
}
);
my $real = Real->new();
$real->add(5); # same as $real->integer($real->integer + 5);
$real->sub(2); # same as $real->integer($real->integer - 2);
Look at those comments doing the explaining for me, we love a self-aware snippet. ๐ฆ
๐ DESCRIPTION ๐
So what even is this? It gives you a simple numeric attribute that comes with most of the basic math operations pre-installed. Like, it's giving calculator but make it Moose. ๐งฎโจ That's the whole description, periodt.
๐ NAME ๐ (yes, again, not a typo, bestie ๐ญ)
MooseX::AttributeHelpers::Number
This page literally has two NAME sections. I don't make the rules, I just deliver them faithfully. ๐
๐ฅ METHODS ๐ฅ
The methods this thing ships with:
metahelper_typemethod_constructors
ngl the original just lists them with zero explanation, so that's what we're doing too. Mysterious. Main character energy. ๐
๐ PROVIDED METHODS ๐
๐จ REAL TALK, READ THIS TWICE: every single one of these methods does an in place modification of the value stored in the attribute. In. Place. Not a copy. Not a new object. The actual value. So act accordingly. ๐
set ($value)โ the alternate way to set the value. Like, another route to the same destination. ๐ฃ๏ธadd ($value)โ adds the current value of the attribute to$value. Math o'clock. โsub ($value)โ subtracts the current value of the attribute to$value. Subtraction, bestie. โmul ($value)โ multiplies the current value of the attribute to$value. Multiplying, slay. โ๏ธdiv ($value)โ divides the current value of the attribute to$value. Division, iconic. โmod ($value)โ modulus the current value of the attribute to$value. The remainder of the bunch. ๐ขabsโ sets the current value of the attribute to its absolute value. Always positive, always glowing, we love that for it. โญ
๐ SUPPORT ๐
Got beef? Found a bug? Same thing, honestly. ๐ Here's where to go:
- Bugs can be submitted through the RT bug tracker at https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-AttributeHelpers, or you can email 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 there's an IRC channel for users of this distribution too โ it's
"#moose"on"irc.perl.org", aka irc://irc.perl.org/#moose. Come say hi, the vibes are immaculate. ๐ซถ
๐ฆ AUTHOR ๐ฆ
Shoutout to the legends who made this:
- Stevan Little
<stevan@iinteractive.com> - Robert Boone
Kings. ๐
โญ COPYRIGHT AND LICENSE โญ
This software is copyright (c) 2007 by Stevan Little and Infinity Interactive, Inc.
It's free software, bestie โ you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Go wild, just keep it legal. ๐
and that's the whole page, bestie!! ๐ This was pulled from perl v5.34.0, dated 2022-06-15, filed under MooseX...Number(3pm). Mwah. Go do some math. ๐
โจ๐ฆ
๐ฆ where this page comes from
- debian bookworm: libmoosex-attributehelpers-perl 0.25-2 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoosex-attributehelpers-perl 0.25-2 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoosex-attributehelpers-perl 0.25-2 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-attributehelpers-perl 0.25-2 ยท Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-attributehelpers-perl 0.25-2 ยท 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