Catmandu/Fix/isbn13.pm

filter: Statementstmt 100% 18 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 95.8% 23 / 24 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Catmandu/Fix/isbn10.pm ↑ Summary Catmandu/Fix/isbn_versions.pm »
1 package Catmandu::Fix::isbn13;
2  
3 1 our $VERSION = '0.15';
4  
5 1 ▶use Catmandu::Sane;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Business::ISBN;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Catmandu::Fix::Has;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 has path => (fix_arg => 1);
11  
12 1 with 'Catmandu::Fix::SimpleGetValue';
13  
14 5 ▶sub emit_value {
Subroutine emit_value: called CC=1 SCAR=0.0
Pod undocumented
15 5 my ($self, $var) = @_;
16  
17 5 "${var} = Business::ISBN->new(${var})->as_isbn13->as_string if is_value(${var}) && length(${var});";
18  
19 }
20  
21 =head1 NAME
22  
23 Catmandu::Fix::isbn13 - normalize the isbn value of a key in 13-digit form
24  
25 =head1 SYNOPSIS
26  
27 # Normalize the ISBN value of isbn_field.
28 # e.g. isbn_field => '1565922573'
29  
30 isbn13(isbn_field) # isbn_field => '978-1-56592-257-0'
31  
32 =head1 SEE ALSO
33  
34 L<Catmandu::Fix>, L<Catmandu::Fix::isbn10>
35  
36 =cut
37  
38 1 1;
« Catmandu/Fix/isbn10.pm ↑ Summary Catmandu/Fix/isbn_versions.pm »