File Coverage

blib/lib/Biblio/ILL/ISO/ItemType.pm
Criterion Covered Total %
statement 19 20 95.0
branch 2 4 50.0
condition 1 3 33.3
subroutine 5 5 100.0
pod 1 1 100.0
total 28 33 84.8


line stmt bran cond sub pod time code
1             package Biblio::ILL::ISO::ItemType;
2              
3             =head1 NAME
4              
5             Biblio::ILL::ISO::ItemType
6              
7             =cut
8              
9 4     4   22 use Biblio::ILL::ISO::ILLASNtype;
  4         7  
  4         99  
10 4     4   20 use Biblio::ILL::ISO::ENUMERATED;
  4         9  
  4         73  
11 4     4   29 use Carp;
  4         18  
  4         409  
12              
13             =head1 VERSION
14              
15             Version 0.01
16              
17             =cut
18              
19             our $VERSION = '0.01';
20             #---------------------------------------------------------------------------
21             # Mods
22             # 0.01 - 2003.07.15 - original version
23             #---------------------------------------------------------------------------
24              
25             =head1 DESCRIPTION
26              
27             Biblio::ILL::ISO::ItemType is a derivation of Biblio::ILL::ISO::ENUMERATED.
28              
29             =head1 USES
30              
31             None.
32              
33             =head1 USED IN
34              
35             Biblio::ILL::ISO::ItemId
36              
37             =cut
38              
39 4     4   796 BEGIN{@ISA = qw ( Biblio::ILL::ISO::ENUMERATED
40             Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype
41              
42             =head1 FROM THE ASN DEFINITION
43            
44             Item-Type ::= ENUMERATED {
45             monograph (1),
46             serial (2),
47             other (3)
48             }
49              
50             =cut
51              
52             =head1 METHODS
53              
54             =cut
55             #---------------------------------------------------------------
56             #
57             #---------------------------------------------------------------
58             =head1
59              
60             =head2 new( $itemtype )
61              
62             Creates a new ItemType object.
63             Valid paramaters are listed in the FROM THE ASN DEFINITION section
64             (e.g. "monograph").
65              
66             =cut
67             sub new {
68 3     3 1 5 my $class = shift;
69 3         6 my $self = {};
70              
71 3         14 $self->{"ENUM_LIST"} = {"monograph" => 1,
72             "serial" => 2,
73             "other" => 3
74             };
75              
76 3 50       10 if (@_) {
77 3         3 my $s = shift;
78            
79 3 50       11 if ( exists $self->{"ENUM_LIST"}->{$s} ) {
80 3         9 $self->{"ENUMERATED"} = $self->{"ENUM_LIST"}->{$s};
81             } else {
82 0         0 croak "invalid ItemType: [$s]";
83             }
84             }
85              
86 3   33     16 bless($self, ref($class) || $class);
87 3         21 return ($self);
88             }
89              
90             =head1 SEE ALSO
91              
92             See the README for system design notes.
93             See the parent class(es) for other available methods.
94              
95             For more information on Interlibrary Loan standards (ISO 10160/10161),
96             a good place to start is:
97              
98             http://www.nlc-bnc.ca/iso/ill/main.htm
99              
100             =cut
101              
102             =head1 AUTHOR
103              
104             David Christensen,
105              
106             =cut
107              
108              
109             =head1 COPYRIGHT AND LICENSE
110              
111             Copyright 2003 by David Christensen
112              
113             This library is free software; you can redistribute it and/or modify it
114             under the same terms as Perl itself.
115              
116             =cut
117              
118             1;