1MooseX::AttributeHelperUss:e:rNuCmobnetrr(i3bpumt)ed PerMlooDsoecXu:m:eAntttartiibounteHelpers::Number(3pm)
2
3
4

NAME

6       MooseX::AttributeHelpers::Number
7

VERSION

9       version 0.25
10

SYNOPSIS

12         package Real;
13         use Moose;
14         use MooseX::AttributeHelpers;
15
16         has 'integer' => (
17             metaclass => 'Number',
18             is        => 'ro',
19             isa       => 'Int',
20             default   => sub { 5 },
21             provides  => {
22                 set => 'set',
23                 add => 'add',
24                 sub => 'sub',
25                 mul => 'mul',
26                 div => 'div',
27                 mod => 'mod',
28                 abs => 'abs',
29             }
30         );
31
32         my $real = Real->new();
33         $real->add(5); # same as $real->integer($real->integer + 5);
34         $real->sub(2); # same as $real->integer($real->integer - 2);
35

DESCRIPTION

37       This provides a simple numeric attribute, which supports most of the
38       basic math operations.
39

NAME

41       MooseX::AttributeHelpers::Number
42

METHODS

44       meta
45       helper_type
46       method_constructors
47

PROVIDED METHODS

49       It is important to note that all those methods do in place modification
50       of the value stored in the attribute.
51
52       set ($value)
53           Alternate way to set the value.
54
55       add ($value)
56           Adds the current value of the attribute to $value.
57
58       sub ($value)
59           Subtracts the current value of the attribute to $value.
60
61       mul ($value)
62           Multiplies the current value of the attribute to $value.
63
64       div ($value)
65           Divides the current value of the attribute to $value.
66
67       mod ($value)
68           Modulus the current value of the attribute to $value.
69
70       abs Sets the current value of the attribute to its absolute value.
71

SUPPORT

73       Bugs may be submitted through the RT bug tracker
74       <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-
75       AttributeHelpers> (or bug-MooseX-AttributeHelpers@rt.cpan.org
76       <mailto:bug-MooseX-AttributeHelpers@rt.cpan.org>).
77
78       There is also a mailing list available for users of this distribution,
79       at <http://lists.perl.org/list/moose.html>.
80
81       There is also an irc channel available for users of this distribution,
82       at "#moose" on "irc.perl.org" <irc://irc.perl.org/#moose>.
83

AUTHOR

85       Stevan Little <stevan@iinteractive.com>
86
87       Robert Boone
88
90       This software is copyright (c) 2007 by Stevan Little and Infinity
91       Interactive, Inc.
92
93       This is free software; you can redistribute it and/or modify it under
94       the same terms as the Perl 5 programming language system itself.
95
96
97
98perl v5.34.0                      2022-01-M2o1oseX::AttributeHelpers::Number(3pm)
Impressum