1 package MooseX::AttributeHelpers::Number;
3 use MooseX::AttributeHelpers::Sugar;
5 extends 'MooseX::AttributeHelpers::Base';
8 our $AUTHORITY = 'cpan:STEVAN';
10 define_attribute_helper (
12 method_provider => 'MooseX::AttributeHelpers::MethodProvider::Number',
17 no MooseX::AttributeHelpers::Sugar;
27 MooseX::AttributeHelpers::Number
33 use MooseX::AttributeHelpers;
36 metaclass => 'Number',
51 my $real = Real->new();
52 $real->add(5); # same as $real->integer($real->integer + 5);
53 $real->sub(2); # same as $real->integer($real->integer - 2);
57 This provides a simple numeric attribute, which supports most of the
58 basic math operations.
60 =head1 METHOD PROVIDER
62 The methods for this metaclass are provided by
63 L<MooseX::AttributeHelpers::MethodProvider::String>.
67 All complex software has bugs lurking in it, and this module is no
68 exception. If you find a bug please either email me, or add the bug
75 =head1 COPYRIGHT AND LICENSE
77 Copyright 2007-2008 by Infinity Interactive, Inc.
79 L<http://www.iinteractive.com>
81 This library is free software; you can redistribute it and/or modify
82 it under the same terms as Perl itself.