line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Valiemon::Attributes::Not; |
2
|
2
|
|
|
2
|
|
1251
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
59
|
|
3
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
47
|
|
4
|
2
|
|
|
2
|
|
9
|
use utf8; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
11
|
|
5
|
2
|
|
|
2
|
|
472
|
use parent qw(Valiemon::Attributes); |
|
2
|
|
|
|
|
340
|
|
|
2
|
|
|
|
|
11
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
122
|
use Carp qw(croak); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
99
|
|
8
|
2
|
|
|
2
|
|
578
|
use List::MoreUtils qw(all); |
|
2
|
|
|
|
|
12568
|
|
|
2
|
|
|
|
|
18
|
|
9
|
|
|
|
|
|
|
|
10
|
12
|
|
|
12
|
0
|
41
|
sub attr_name { 'not' } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub is_valid { |
13
|
12
|
|
|
12
|
0
|
29
|
my ($class, $context, $schema, $data) = @_; |
14
|
|
|
|
|
|
|
$context->in_attr($class, sub { |
15
|
12
|
|
|
12
|
|
20
|
my $not = $schema->{not}; |
16
|
12
|
100
|
|
|
|
44
|
unless (ref $not eq 'HASH') { |
17
|
1
|
|
|
|
|
4
|
croak sprintf '`not` must be an object at %s', $context->position |
18
|
|
|
|
|
|
|
} |
19
|
11
|
|
|
|
|
29
|
my $sub_v = $context->sub_validator($not); |
20
|
11
|
|
|
|
|
31
|
my $res = $sub_v->validate($data); |
21
|
11
|
|
|
|
|
45
|
return !$res; |
22
|
12
|
|
|
|
|
75
|
}); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |