Filter/Plugin/AACR2.pm

filter: Statementstmt 100% 3 / 3 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 100% 4 / 4 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
CRAP 1.0
« Filter/Abstract.pm ↑ Summary Filter/Plugin/Material.pm »
1 package MARC::Validator::Filter::Plugin::AACR2;
2  
3 3 ▶use base qw(MARC::Validator::Filter::Abstract);
Subroutine BEGIN: called CC=1 SCAR=0.0
4 use strict;
5 use warnings;
6  
7 use English;
8 use MARC::Leader 0.08;
9  
10 our $VERSION = 0.01;
11  
12 sub name {
13 my $self = shift;
14  
15 return 'aacr2';
16 }
17  
18 sub process {
19 my ($self, $marc_record) = @_;
20  
21 my $leader_string = $marc_record->leader;
22 my $leader = eval {
23 MARC::Leader->new(
24 'verbose' => $self->{'verbose'},
25 )->parse($leader_string);
26 };
27 if ($EVAL_ERROR) {
28 return;
29 }
30 if ($leader->descriptive_cataloging_form ne 'a') {
31 return;
32 }
33  
34 return 'aacr2';
35 }
36  
37 1;
38  
39 __END__
« Filter/Abstract.pm ↑ Summary Filter/Plugin/Material.pm »