package MooseX::Types::Common::Numeric;
+# ABSTRACT: Commonly used numeric types
use strict;
use warnings;
-our $VERSION = '0.001008';
-
use MooseX::Types -declare => [
qw(PositiveNum PositiveOrZeroNum
PositiveInt PositiveOrZeroInt
);
subtype SingleDigit,
- as PositiveInt,
- where { $_ <= 9 },
+ as Int,
+ where { $_ >= -9 and $_ <= 9 },
message { "Must be a single digit" },
( $Moose::VERSION >= 2.0200
? inline_as {
$_[0]->parent()->_inline_check( $_[1] ) . ' && '
- . qq{ ($_[1] <= 9) };
+ . qq{ ($_[1] >= -9 and $_[1] <= 9) };
}
: ()
);
1;
-__END__;
-
-=head1 NAME
+__END__
-MooseX::Types::Common::Numeric - Commonly used numeric types
+=pod
=head1 SYNOPSIS
=over
-=item * PositiveNum
+=item * C<PositiveNum>
-=item * PositiveOrZeroNum
+=item * C<PositiveOrZeroNum>
-=item * PositiveInt
+=item * C<PositiveInt>
-=item * PositiveOrZeroInt
+=item * C<PositiveOrZeroInt>
-=item * NegativeNum
+=item * C<NegativeNum>
-=item * NegativeOrZeroNum
+=item * C<NegativeOrZeroNum>
-=item * NegativeInt
+=item * C<NegativeInt>
-=item * NegativeOrZeroInt
+=item * C<NegativeOrZeroInt>
-=item * SingleDigit
+=item * C<SingleDigit>
=back
=back
-=head1 AUTHORS
-
-Please see:: L<MooseX::Types::Common>
-
=cut