line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::Condition::any_equal; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
758
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
7
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.2020'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
7
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
8
|
1
|
|
|
1
|
|
391
|
use namespace::clean; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
5
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends 'Catmandu::Fix::Condition::all_equal'; |
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
2
|
|
33
|
sub _build_mode {'any'} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
1; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
__END__ |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=pod |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Catmandu::Fix::Condition::any_equal - Execute fixes when at least one of the path values equal a string value |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
This fix is meant as an simple alternative to L<Catmandu::Fix::Condition::any_match>. |
27
|
|
|
|
|
|
|
No regular expressions are involved. String are compared using the regular |
28
|
|
|
|
|
|
|
operator 'eq'. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 SYNOPSIS |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# any_equal(X,Y) is true when at least one value of the array X equals 'Y' |
33
|
|
|
|
|
|
|
if any_equal('years.*','2018') |
34
|
|
|
|
|
|
|
add_field('my.funny.title','true') |
35
|
|
|
|
|
|
|
end |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# any_equal(X,Y) is false when none of the values of X equal 'Y' |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SEE ALSO |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
L<Catmandu::Fix> , L<Catmandu::Fix::Condition::all_equal> |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |