Method-ParamValidator

 view release on metacpan or  search on metacpan

lib/Method/ParamValidator/Key/Field.pm  view on Meta::CPAN


use Moo;
use namespace::autoclean;

use Types::Standard qw(:all);
use Method::ParamValidator::Key::Field::DataType qw(:all);

has 'name'    => (is => 'ro', isa => Str,          required  => 1);
has 'format'  => (is => 'ro', isa => Str,          default   => sub { 's' });
has 'check'   => (is => 'rw', isa => CodeRef,      predicate => 1);
has 'source'  => (is => 'ro', isa => HashRef[Str], predicate => 1);
has 'message' => (is => 'ro', isa => Str);
has 'multi'   => (is => 'ro');

sub str { !(defined $_[0] && $_[0] =~ /^\d+$/) };
sub int {  (defined $_[0] && $_[0] =~ /^\d+$/) };

=head1 DESCRIPTION

B<FOR INTERNAL USE ONLY>.



( run in 0.581 second using v1.01-cache-2.11-cpan-5f2e87ce722 )