line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MultipleOf; |
2
|
|
|
|
|
|
|
|
3
|
44
|
|
|
44
|
|
29921
|
use strict; |
|
44
|
|
|
|
|
90
|
|
|
44
|
|
|
|
|
1382
|
|
4
|
44
|
|
|
44
|
|
211
|
use warnings; |
|
44
|
|
|
|
|
67
|
|
|
44
|
|
|
|
|
1115
|
|
5
|
44
|
|
|
44
|
|
226
|
use parent qw(JSV::Keyword); |
|
44
|
|
|
|
|
78
|
|
|
44
|
|
|
|
|
228
|
|
6
|
|
|
|
|
|
|
|
7
|
44
|
|
|
44
|
|
2099
|
use JSV::Keyword qw(:constants); |
|
44
|
|
|
|
|
87
|
|
|
44
|
|
|
|
|
9813
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub instance_type() { INSTANCE_TYPE_NUMERIC(); } |
10
|
|
|
|
|
|
|
sub keyword() { "multipleOf" } |
11
|
|
|
|
|
|
|
sub keyword_priority() { 10; } |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub validate { |
14
|
49
|
|
|
49
|
0
|
90
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
49
|
|
|
|
|
164
|
my $keyword_value = $class->keyword_value($schema); |
17
|
49
|
|
|
|
|
119
|
my $result = $instance / $keyword_value; |
18
|
|
|
|
|
|
|
|
19
|
49
|
100
|
|
|
|
446
|
if ($result - int($result) != 0) { |
20
|
21
|
|
|
|
|
1031
|
$context->log_error("The instance doesn't multiple of schema value"); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |