| 1 | package Catmandu::Fix::sfx_year_range; | ||
| 2 | |||
| 3 | 1 | ▶ | use Catmandu::Sane; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use Catmandu::Util qw(:is); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Catmandu::SFX; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use Catmandu::Fix::Has; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 1 | has path => (fix_arg => 1); | |
| 10 | |||
| 11 | 1 | with 'Catmandu::Fix::SimpleGetValue'; | |
| 12 | |||
| 13 | 1 | ▶ | sub emit_value { |
|
Subroutine
emit_value: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 14 | 1 | my ($self, $var, $fixer) = @_; | |
| 15 | 1 | my $sfx = $fixer->capture(Catmandu::SFX->new()); | |
| 16 | 1 | "if (is_array_ref(${var})) {" . | |
| 17 | "${var} = ${sfx}->parse_sfx_year_range(${var}); " . | ||
| 18 | "}"; | ||
| 19 | } | ||
| 20 | |||
| 21 | 1 | 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 <Patrick.Hochstenbach@UGent.be> | ||
| 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 | ||