line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
use Catmandu::Sane; |
3
|
1
|
|
|
1
|
|
573
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.2019'; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Moo; |
7
|
1
|
|
|
1
|
|
9
|
use Catmandu::Util qw(is_value); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
8
|
1
|
|
|
1
|
|
372
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
56
|
|
9
|
1
|
|
|
1
|
|
7
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
5
|
|
10
|
1
|
|
|
1
|
|
267
|
|
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
6
|
|
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
|
|
16
|
sub { |
19
|
2
|
|
|
|
|
8
|
my $v = $_[0]; |
20
|
|
|
|
|
|
|
is_value($v) && $v < $value; |
21
|
4
|
|
|
4
|
|
7
|
}; |
22
|
4
|
50
|
|
|
|
87
|
} |
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 |