File Coverage

blib/lib/Input/Validator/Constraint.pm
Criterion Covered Total %
statement 23 23 100.0
branch 1 2 50.0
condition 2 2 100.0
subroutine 9 9 100.0
pod 3 5 60.0
total 38 41 92.6


line stmt bran cond sub pod time code
1             package Input::Validator::Constraint;
2              
3 21     21   22595 use strict;
  21         34  
  21         610  
4 21     21   98 use warnings;
  21         34  
  21         546  
5              
6 21     21   91 use base 'Input::Validator::Base';
  21         32  
  21         7380  
7              
8 21     21   9823 use String::CamelCase ();
  21         6531  
  21         3805  
9              
10             sub BUILD {
11 53     53 0 88 my $self = shift;
12              
13 53   100     363 $self->{args} ||= [];
14              
15 53         128 return $self;
16             }
17              
18 1     1 1 372 sub is_valid {0}
19 39     39 0 112 sub is_multiple {0}
20              
21 112     112 1 335 sub args { shift->{args} }
22              
23             sub error {
24 22     22 1 31 my $self = shift;
25              
26 22 50       73 my $name = ref($self) ? ref($self) : $self;
27 22         28 my $namespace = __PACKAGE__;
28 22         222 $name =~ s/^$namespace\:://;
29              
30 22         73 return uc(String::CamelCase::decamelize($name)) . '_CONSTRAINT_FAILED';
31             }
32              
33             1;
34             __END__