line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Valiemon::Attributes::Minimum; |
2
|
3
|
|
|
3
|
|
1356
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
74
|
|
3
|
3
|
|
|
3
|
|
10
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
60
|
|
4
|
3
|
|
|
3
|
|
11
|
use utf8; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
12
|
|
5
|
3
|
|
|
3
|
|
450
|
use parent qw(Valiemon::Attributes); |
|
3
|
|
|
|
|
241
|
|
|
3
|
|
|
|
|
12
|
|
6
|
|
|
|
|
|
|
|
7
|
21
|
|
|
21
|
0
|
83
|
sub attr_name { 'minimum' } |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub is_valid { |
10
|
23
|
|
|
23
|
0
|
31
|
my ($class, $context, $schema, $data) = @_; |
11
|
|
|
|
|
|
|
|
12
|
23
|
100
|
|
|
|
53
|
return 1 unless $context->prims->is_number($data); # skip on non-number value |
13
|
|
|
|
|
|
|
|
14
|
21
|
|
|
|
|
30
|
my $min = $schema->{minimum}; |
15
|
21
|
|
100
|
|
|
59
|
my $exclusive = $schema->{exclusiveMinimum} || 0; |
16
|
|
|
|
|
|
|
$context->in_attr($class, sub { |
17
|
3
|
|
|
3
|
|
374
|
no warnings 'numeric'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
247
|
|
18
|
21
|
100
|
|
21
|
|
59
|
$exclusive ? $min < $data : $min <= $data; |
19
|
21
|
|
|
|
|
118
|
}); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |