line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
1
|
|
|
1
|
|
734
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2018'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
1
|
|
|
1
|
|
6
|
use Catmandu::Util qw(is_value); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
8
|
1
|
|
|
1
|
|
347
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
54
|
|
9
|
1
|
|
|
1
|
|
14
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
9
|
|
10
|
1
|
|
|
1
|
|
307
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
11
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
12
|
|
|
|
|
|
|
has value => (fix_arg => 1); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
with 'Catmandu::Fix::Condition::Builder::Simple'; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
my ($self) = @_; |
17
|
|
|
|
|
|
|
my $value = int($self->value); |
18
|
2
|
|
|
2
|
|
17
|
sub { |
19
|
2
|
|
|
|
|
21
|
my $v = $_[0]; |
20
|
|
|
|
|
|
|
is_value($v) && $v < $value; |
21
|
4
|
|
|
4
|
|
8
|
}; |
22
|
4
|
50
|
|
|
|
86
|
} |
23
|
2
|
|
|
|
|
9
|
|
24
|
|
|
|
|
|
|
1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=pod |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=head1 NAME |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
Catmandu::Fix::Condition::less_than - Excute fixes when a field is less than a value |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 SYNOPSIS |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
# less_than(X,Y) is true when X < Y |
36
|
|
|
|
|
|
|
if less_than('year','2018') |
37
|
|
|
|
|
|
|
add_field('my.funny.title','true') |
38
|
|
|
|
|
|
|
end |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# less_than on arrays checks if all values are X < Y |
41
|
|
|
|
|
|
|
if less_than('years.*','2018') |
42
|
|
|
|
|
|
|
add_field('my.funny.title','true') |
43
|
|
|
|
|
|
|
end |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 SEE ALSO |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
L<Catmandu::Fix::Condition::greater_than> |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=cut |