lib/Biblio/ILL/ISO/ILLServiceType.pm

filter: Statementstmt 95.4% 21 / 22 Branchbran 50.0% 2 / 4 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 81.0% 30 / 37 CC 4 SCAR 9.9
CC
4
Cov
83%
new
4.4
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« lib/Biblio/ILL/ISO/ILLAPDUtype.pm ↑ Summary lib/Biblio/ILL/ISO/IntermediaryProblem.pm »
1 package Biblio::ILL::ISO::ILLServiceType;
2  
3 =head1 NAME
4  
5 Biblio::ILL::ISO::ILLServiceType
6  
7 =cut
8  
9 4 ▶use Biblio::ILL::ISO::ILLASNtype;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use Biblio::ILL::ISO::ENUMERATED;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 =head1 VERSION
15  
16 Version 0.01
17  
18 =cut
19  
20 4 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::ILLServiceType 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::ILLServiceTypeSequence
37 Biblio::ILL::ISO::Request
38  
39 =cut
40  
41 4 ▶BEGIN{@ISA = qw ( Biblio::ILL::ISO::ENUMERATED
Subroutine BEGIN: called CC=1 SCAR=0.0
42 Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype
43  
44 =head1 FROM THE ASN DEFINITION
45
46 ILL-Service-Type ::= ENUMERATED {
47 loan (1),
48 copy-non-returnable (2),
49 locations (3),
50 estimate (4),
51 responder-specific (5)
52 }
53  
54 =cut
55  
56 =head1 METHODS
57  
58 =cut
59  
60 #---------------------------------------------------------------
61 #
62 #---------------------------------------------------------------
63 =head1
64  
65 =head2 new( $service_type )
66  
67 Creates a new ILLServiceType object.
68 Valid paramaters are listed in the FROM THE ASN DEFINITION section
69 (e.g. "loan").
70  
71 =cut
72 6 ▶sub new {
Subroutine new: called CC=4 SCAR=14.8
Pod documented
73 6 my $class = shift;
74 6 my $self = {};
75  
76 6 $self->{"ENUM_LIST"} = {"loan" => 1,
77 "copy-non-returnable" => 2,
78 "locations" => 3,
79 "estimate" => 4,
80 "responder-specific" => 5
81 };
82  
83 6 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 6 0 6
84 6 my $s = shift;
85
86 6 ▶ if ( exists $self->{"ENUM_LIST"}->{$s} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'ENUM_LIST'}{$s}) { } 6 0 6
87 6 $self->{"ENUMERATED"} = $self->{"ENUM_LIST"}->{$s};
88 } else {
89 0 croak "invalid ILLServiceType: [$s]";
90 }
91 }
92  
93 6 ▶ bless($self, ref($class) || $class);
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
060
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
94 6 return ($self);
95 }
96  
97 =head1 SEE ALSO
98  
99 See the README for system design notes.
100 See the parent class(es) for other available methods.
101  
102 For more information on Interlibrary Loan standards (ISO 10160/10161),
103 a good place to start is:
104  
105 http://www.nlc-bnc.ca/iso/ill/main.htm
106  
107 =cut
108  
109 =head1 AUTHOR
110  
111 David Christensen, <DChristensenSPAMLESS@westman.wave.ca>
112  
113 =cut
114  
115  
116 =head1 COPYRIGHT AND LICENSE
117  
118 Copyright 2003 by David Christensen
119  
120 This library is free software; you can redistribute it and/or modify it
121 under the same terms as Perl itself.
122  
123 =cut
124  
125 4 1;
« lib/Biblio/ILL/ISO/ILLAPDUtype.pm ↑ Summary lib/Biblio/ILL/ISO/IntermediaryProblem.pm »