line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Valiemon::Attributes::Minimum; |
2
|
3
|
|
|
3
|
|
1967
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
94
|
|
3
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
75
|
|
4
|
3
|
|
|
3
|
|
16
|
use utf8; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
26
|
|
5
|
3
|
|
|
3
|
|
524
|
use parent qw(Valiemon::Attributes); |
|
3
|
|
|
|
|
312
|
|
|
3
|
|
|
|
|
20
|
|
6
|
|
|
|
|
|
|
|
7
|
21
|
|
|
21
|
0
|
69
|
sub attr_name { 'minimum' } |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub is_valid { |
10
|
23
|
|
|
23
|
0
|
63
|
my ($class, $context, $schema, $data) = @_; |
11
|
|
|
|
|
|
|
|
12
|
23
|
100
|
|
|
|
73
|
return 1 unless $context->prims->is_number($data); # skip on non-number value |
13
|
|
|
|
|
|
|
|
14
|
21
|
|
|
|
|
58
|
my $min = $schema->{minimum}; |
15
|
21
|
|
100
|
|
|
81
|
my $exclusive = $schema->{exclusiveMinimum} || 0; |
16
|
|
|
|
|
|
|
$context->in_attr($class, sub { |
17
|
3
|
|
|
3
|
|
430
|
no warnings 'numeric'; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
307
|
|
18
|
21
|
100
|
|
21
|
|
79
|
$exclusive ? $min < $data : $min <= $data; |
19
|
21
|
|
|
|
|
157
|
}); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
1; |