ARK/Writer.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran 0.0% 0 / 6 Conditioncond n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 31 CC 4 SCAR 25.1
CC
4
Cov
0%
write
20.0
BEGIN
2.0
BEGIN
2.0
CRAP 12.3
1 package Koha::Contrib::ARK::Writer;
2 $Koha::Contrib::ARK::Writer::VERSION = '1.0.3';
3 # ABSTRACT: Write biblio records into Koha Catalog
4 use Moose;
5  
6 with 'MooseX::RW::Writer';
7  
8 use Modern::Perl;
9 use C4::Biblio;
10  
11  
12 has ark => ( is => 'rw', isa => 'Koha::Contrib::ARK' );
13  
14  
15 sub write {
16 my ($self, $biblionumber, $record) = @_;
17  
18 return unless $record;
19  
20 my $a = $self->ark;
21 if ($a->doit) {
22 my $fc = GetFrameworkCode($biblionumber);
23 ModBiblio( $record->as('Legacy'), $biblionumber, $fc );
24 }
25 $a->current->{after} = Koha::Contrib::ARK::tojson($record)
26 if $a->debug;
27 }
28  
29  
30 1;
31  
32 __END__
33  
34 =pod
35  
36 =encoding UTF-8
37  
38 =head1 NAME
39  
40 Koha::Contrib::ARK::Writer - Write biblio records into Koha Catalog
41  
42 =head1 VERSION
43  
44 version 1.0.3
45  
46 =head1 ATTRIBUTES
47  
48 =head2 ark
49  
50 L<Koha::Contrib::ARK> object.
51  
52 =head1 AUTHOR
53  
54 Frédéric Demians <f.demians@tamil.fr>
55  
56 =head1 COPYRIGHT AND LICENSE
57  
58 This software is Copyright (c) 2018 by Fréderic Demians.
59  
60 This is free software, licensed under:
61  
62 The GNU General Public License, Version 3, June 2007
63  
64 =cut