NAME

MARC::Convert::Wikidata::Object::ISBN - Bibliographic Wikidata object for ISBN number defined by MARC record.

SYNOPSIS

use MARC::Convert::Wikidata::Object::ISBN;

my $obj = MARC::Convert::Wikidata::Object::ISBN->new(%params);
my $collective = $obj->collective.
my $cover = $obj->cover;
my $isbn = $obj->isbn;
my $publisher = $obj->publisher;
my $type = $obj->type;

METHODS

new

my $obj = MARC::Convert::Wikidata::Object::ISBN->new(%params);

Constructor.

Returns instance of object.

  • collective

    ISBN collective flag.

    Parameter means that ISBN is for collection.

    Valid value is boolean (0/1).

    Default value is 0.

  • cover

    ISBN cover.

    Parameter is optional. Valid values are: hardback, paperback

    Default value is undef.

  • isbn

    ISBN number.

    Parameter is required.

    Default value is undef.

  • publisher

    Publishing house object. Instance of MARC::Convert::Wikidata::Object::Publisher.

    Default value is undef.

collective

my $collective = $obj->collective.

Get collective flag.

Returns bool (0/1).

cover

my $cover = $obj->cover;

Get ISBN cover.

Returns string.

isbn

my $isbn = $obj->isbn;

Get ISBN number.

Returns string.

publisher

my $publisher = $obj->publisher;

Get publishing house name.

Returns instance of MARC::Convert::Wikidata::Object::Publisher.

type

my $type = $obj->type;

Get type of ISBN number (10 or 13 character length)

Returns number (10 or 13).

ERRORS

new():
        Parameter 'collective' must be a bool (0/1).
        Parameter 'isbn' is required.
        ISBN '%s' isn't valid.
        ISBN cover '%s' isn't valid.
        From check_isa():
                Parameter 'publisher' must be a 'MARC::Convert::Wikidata::Object::Publisher' object.

EXAMPLE1

use strict;
use warnings;

use Data::Printer;
use MARC::Convert::Wikidata::Object::ISBN;
use MARC::Convert::Wikidata::Object::Publisher;

my $obj = MARC::Convert::Wikidata::Object::ISBN->new(
        'isbn' => '978-80-00-05046-1',
        'publisher' => MARC::Convert::Wikidata::Object::Publisher->new(
                'name' => 'Albatros',
        ),
);

p $obj;

# Output:
# MARC::Convert::Wikidata::Object::ISBN  {
#     parents: Mo::Object
#     public methods (8):
#         BUILD, type
#         Error::Pure:
#             err
#         List::Util:
#             none
#         Mo::utils:
#             check_bool, check_isa, check_required
#         Readonly:
#             Readonly
#     private methods (0)
#     internals: {
#         _isbn        978-80-00-05046-1 (Business::ISBN13),
#         collective   0,
#         isbn         "978-80-00-05046-1" (dualvar: 978),
#         publisher    MARC::Convert::Wikidata::Object::Publisher
#     }
# }

DEPENDENCIES

Business::ISBN, Error::Pure, Mo, Mo::utils, List::Util, Readonly.

SEE ALSO

MARC::Convert::Wikidata

Conversion class between MARC record and Wikidata object.

REPOSITORY

https://github.com/michal-josef-spacek/MARC-Convert-Wikidata-Object

AUTHOR

Michal Josef Špaček mailto:skim@cpan.org

http://skim.cz

LICENSE AND COPYRIGHT

© Michal Josef Špaček 2021-2024

BSD 2-Clause License

VERSION

0.09