line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Valiemon::Attributes::Not; |
2
|
2
|
|
|
2
|
|
1010
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
64
|
|
3
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
43
|
|
4
|
2
|
|
|
2
|
|
6
|
use utf8; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
9
|
|
5
|
2
|
|
|
2
|
|
417
|
use parent qw(Valiemon::Attributes); |
|
2
|
|
|
|
|
251
|
|
|
2
|
|
|
|
|
8
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
88
|
use Carp qw(croak); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
84
|
|
8
|
2
|
|
|
2
|
|
415
|
use List::MoreUtils qw(all); |
|
2
|
|
|
|
|
7301
|
|
|
2
|
|
|
|
|
16
|
|
9
|
|
|
|
|
|
|
|
10
|
12
|
|
|
12
|
0
|
22
|
sub attr_name { 'not' } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub is_valid { |
13
|
12
|
|
|
12
|
0
|
17
|
my ($class, $context, $schema, $data) = @_; |
14
|
|
|
|
|
|
|
$context->in_attr($class, sub { |
15
|
12
|
|
|
12
|
|
12
|
my $not = $schema->{not}; |
16
|
12
|
100
|
|
|
|
21
|
unless (ref $not eq 'HASH') { |
17
|
1
|
|
|
|
|
2
|
croak sprintf '`not` must be an object at %s', $context->position |
18
|
|
|
|
|
|
|
} |
19
|
11
|
|
|
|
|
22
|
my $sub_v = $context->sub_validator($not); |
20
|
11
|
|
|
|
|
26
|
my $res = $sub_v->validate($data); |
21
|
11
|
|
|
|
|
28
|
return !$res; |
22
|
12
|
|
|
|
|
46
|
}); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |