line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MultipleOf; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
21728
|
use strict; |
|
47
|
|
|
|
|
60
|
|
|
47
|
|
|
|
|
1474
|
|
4
|
47
|
|
|
47
|
|
152
|
use warnings; |
|
47
|
|
|
|
|
46
|
|
|
47
|
|
|
|
|
960
|
|
5
|
47
|
|
|
47
|
|
134
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
54
|
|
|
47
|
|
|
|
|
165
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
1889
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
63
|
|
|
47
|
|
|
|
|
8426
|
|
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
|
47
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
49
|
|
|
|
|
96
|
my $keyword_value = $class->keyword_value($schema); |
17
|
49
|
|
|
|
|
71
|
my $result = $instance / $keyword_value; |
18
|
|
|
|
|
|
|
|
19
|
49
|
100
|
|
|
|
135
|
if ($result - int($result) != 0) { |
20
|
21
|
|
|
|
|
49
|
$context->log_error("The instance doesn't multiple of schema value"); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |