| 1 | package MARC::Moose::Formater::Legacy; | ||||||||||||||||||
| 2 | # ABSTRACT: Record formater into the legacy MARC::Record object | ||||||||||||||||||
| 3 | 4 | $MARC::Moose::Formater::Legacy::VERSION = '1.0.46'; | |||||||||||||||||
| 4 | 4 | ▶ | use Moose; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 5 | |||||||||||||||||||
| 6 | 4 | extends 'MARC::Moose::Formater'; | |||||||||||||||||
| 7 | |||||||||||||||||||
| 8 | 4 | ▶ | use MARC::Moose::Field::Control; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 9 | 4 | ▶ | use MARC::Moose::Field::Std; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 10 | 4 | ▶ | use MARC::Record; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 11 | |||||||||||||||||||
| 12 | |||||||||||||||||||
| 13 | override 'format' => sub { | ||||||||||||||||||
| 14 | 0 | ▶ | my ($self, $record) = @_; | ||||||||||||||||
|
Subroutine
__ANON__: not called CC=9 SCAR=45.0
| |||||||||||||||||||
| 15 | |||||||||||||||||||
| 16 | 0 | my $marc = MARC::Record->new; | |||||||||||||||||
| 17 | 0 | $marc->leader( $record->leader ); | |||||||||||||||||
| 18 | 0 | for my $field ( @{$record->fields} ) { | |||||||||||||||||
| 19 | 0 | my $nfield; | |||||||||||||||||
| 20 | 0 | ▶ | if ( $field->tag < 10 ) { | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 21 | 0 | my $value = $field->value; | |||||||||||||||||
| 22 | 0 | $nfield = MARC::Field->new( $field->tag, $field->value ); | |||||||||||||||||
| 23 | } | ||||||||||||||||||
| 24 | else { | ||||||||||||||||||
| 25 | 0 | my @sf; | |||||||||||||||||
| 26 | 0 | for (@{$field->subf}) { | |||||||||||||||||
| 27 | 0 | my ($letter, $value) = @$_; | |||||||||||||||||
| 28 | 0 | ▶ | push @sf, $letter, $value if defined $value; | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 29 | } | ||||||||||||||||||
| 30 | 0 | ▶ | $nfield = MARC::Field->new( | ||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||
| 31 | $field->tag, | ||||||||||||||||||
| 32 | (defined $field->ind1 ) ? $field->ind1 : ' ', | ||||||||||||||||||
| 33 | (defined $field->ind2 ) ? $field->ind2 : ' ', @sf ) if @sf; | ||||||||||||||||||
| 34 | } | ||||||||||||||||||
| 35 | 0 | ▶ | $marc->append_fields($nfield) if $nfield; | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 36 | } | ||||||||||||||||||
| 37 | 0 | return $marc; | |||||||||||||||||
| 38 | 4 | }; | |||||||||||||||||
| 39 | |||||||||||||||||||
| 40 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||
| 41 | 4 | 1; | |||||||||||||||||
| 42 | |||||||||||||||||||
| 43 | __END__ | ||||||||||||||||||
| 44 | |||||||||||||||||||
| 45 | =pod | ||||||||||||||||||
| 46 | |||||||||||||||||||
| 47 | =encoding UTF-8 | ||||||||||||||||||
| 48 | |||||||||||||||||||
| 49 | =head1 NAME | ||||||||||||||||||
| 50 | |||||||||||||||||||
| 51 | MARC::Moose::Formater::Legacy - Record formater into the legacy MARC::Record object | ||||||||||||||||||
| 52 | |||||||||||||||||||
| 53 | =head1 VERSION | ||||||||||||||||||
| 54 | |||||||||||||||||||
| 55 | version 1.0.46 | ||||||||||||||||||
| 56 | |||||||||||||||||||
| 57 | =head1 AUTHOR | ||||||||||||||||||
| 58 | |||||||||||||||||||
| 59 | Frédéric Demians <f.demians@tamil.fr> | ||||||||||||||||||
| 60 | |||||||||||||||||||
| 61 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||
| 62 | |||||||||||||||||||
| 63 | This software is copyright (c) 2022 by Frédéric Demians. | ||||||||||||||||||
| 64 | |||||||||||||||||||
| 65 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||
| 66 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||
| 67 | |||||||||||||||||||
| 68 | =cut | ||||||||||||||||||