blib/lib/Catmandu/Fix/Condition/greater_than.pm

filter: Statementstmt 100% 20 / 20 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.1% 25 / 26 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Catmandu/Fix/Condition/any_equal.pm ↑ Summary blib/lib/Catmandu/Fix/Condition/less_than.pm »
1 package Catmandu::Fix::Condition::greater_than;
2  
3 1 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 our $VERSION = '1.0201_02';
6  
7 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use namespace::clean;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use Catmandu::Fix::Has;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 has path => (fix_arg => 1);
12 1 has value => (fix_arg => 1);
13  
14 1 with 'Catmandu::Fix::Condition::SimpleAllTest';
15  
16 sub emit_test {
17 2 ▶ my ($self, $var) = @_;
Subroutine emit_test: called CC=1 SCAR=0.0
Pod undocumented
18 2 my $value = $self->value;
19 2 "is_value(${var}) && ${var} > int('$value')";
20 }
21  
22 1 1;
23  
24 __END__
25  
26 =pod
27  
28 =head1 NAME
29  
30 Catmandu::Fix::Condition::greater_than - Excute fixes when a field is greater than a value
31  
32 =head1 SYNOPSIS
33  
34 # greater_than(X,Y) is true when X > Y
35 if greater_than('year','2018')
36 add_field('my.funny.title','true')
37 end
38  
39 # greater_than on arrays checks if all values are X > Y
40 if greater_than('years.*','2018')
41 add_field('my.funny.title','true')
42 end
43  
44 =head1 SEE ALSO
45  
46 L<Catmandu::Fix::Condition::less_than>
47  
48 =cut
« blib/lib/Catmandu/Fix/Condition/any_equal.pm ↑ Summary blib/lib/Catmandu/Fix/Condition/less_than.pm »