1 package MooseX::Types::Common::Numeric;
6 our $VERSION = '0.001001';
8 use MooseX::Types -declare => [
9 qw(PositiveNum PositiveInt NegativeNum NegativeInt SingleDigit)
12 use MooseX::Types::Moose qw/Num Int/;
17 message { "Must be a positive number" },
18 ( $Moose::VERSION >= 2.0200
20 $_[0]->parent()->_inline_check( $_[1] ) . ' && '
29 message { "Must be a positive integer" },
30 ( $Moose::VERSION >= 2.0200
32 $_[0]->parent()->_inline_check( $_[1] ) . ' && '
41 message { "Must be a negative number" },
42 ( $Moose::VERSION >= 2.0200
44 $_[0]->parent()->_inline_check( $_[1] ) . ' && '
53 message { "Must be a negative integer" },
54 ( $Moose::VERSION >= 2.0200
56 $_[0]->parent()->_inline_check( $_[1] ) . ' && '
65 message { "Must be a single digit" },
66 ( $Moose::VERSION >= 2.0200
68 $_[0]->parent()->_inline_check( $_[1] ) . ' && '
80 MooseX::Types::Common::Numeric - Commonly used numeric types
84 use MooseX::Types::Common::Numeric qw/PositiveInt/;
85 has count => (is => 'rw', isa => PositiveInt);
93 A set of commonly-used numeric type constraints that do not ship with Moose by
114 =item * L<MooseX::Types::Common::String>
120 Please see:: L<MooseX::Types::Common>