line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::sfx_year_range; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
26993
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
93451
|
|
|
1
|
|
|
|
|
8
|
|
4
|
1
|
|
|
1
|
|
952
|
use Catmandu::Util qw(:is); |
|
1
|
|
|
|
|
41334
|
|
|
1
|
|
|
|
|
329
|
|
5
|
1
|
|
|
1
|
|
7
|
use Moo; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
7
|
|
6
|
1
|
|
|
1
|
|
722
|
use Catmandu::SFX; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
7
|
1
|
|
|
1
|
|
406
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
1047
|
|
|
1
|
|
|
|
|
5
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
with 'Catmandu::Fix::SimpleGetValue'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub emit_value { |
14
|
1
|
|
|
1
|
0
|
6164
|
my ($self, $var, $fixer) = @_; |
15
|
1
|
|
|
|
|
12
|
my $sfx = $fixer->capture(Catmandu::SFX->new()); |
16
|
1
|
|
|
|
|
87
|
"if (is_array_ref(${var})) {" . |
17
|
|
|
|
|
|
|
"${var} = ${sfx}->parse_sfx_year_range(${var}); " . |
18
|
|
|
|
|
|
|
"}"; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=encoding utf-8 |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
=head1 NAME |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
Catmandu::Fix::sfx_year_range - parse the SFX threshold data |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# Parse an array of years into a human reabable string |
30
|
|
|
|
|
|
|
# E.g. |
31
|
|
|
|
|
|
|
# holding: 1900 , 1901 , 1902 , 1920 , 1980 , 1981 , 1982 |
32
|
|
|
|
|
|
|
sfx_year_range(holding) |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# Holding will be: 1900 - 1902 ; 1920 ; 1980 - 1982 |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 AUTHOR |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
Patrick Hochstenbach |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
This software is copyright (c) 20145by Patrick Hochstenbach. |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
45
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |