File Coverage

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