line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSV::Keyword::Draft4::MultipleOf; |
2
|
|
|
|
|
|
|
|
3
|
47
|
|
|
47
|
|
36787
|
use strict; |
|
47
|
|
|
|
|
109
|
|
|
47
|
|
|
|
|
1905
|
|
4
|
47
|
|
|
47
|
|
262
|
use warnings; |
|
47
|
|
|
|
|
94
|
|
|
47
|
|
|
|
|
1361
|
|
5
|
47
|
|
|
47
|
|
243
|
use parent qw(JSV::Keyword); |
|
47
|
|
|
|
|
92
|
|
|
47
|
|
|
|
|
275
|
|
6
|
|
|
|
|
|
|
|
7
|
47
|
|
|
47
|
|
2695
|
use JSV::Keyword qw(:constants); |
|
47
|
|
|
|
|
109
|
|
|
47
|
|
|
|
|
12014
|
|
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
|
96
|
my ($class, $context, $schema, $instance) = @_; |
15
|
|
|
|
|
|
|
|
16
|
49
|
|
|
|
|
180
|
my $keyword_value = $class->keyword_value($schema); |
17
|
49
|
|
|
|
|
174
|
my $result = $instance / $keyword_value; |
18
|
|
|
|
|
|
|
|
19
|
49
|
100
|
|
|
|
216
|
if ($result - int($result) != 0) { |
20
|
21
|
|
|
|
|
75
|
$context->log_error("The instance doesn't multiple of schema value"); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
1; |