lib/Biblio/ILL/ISO/ShippedServiceType.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/ShippedConditions.pm ↑ Summary lib/Biblio/ILL/ISO/SupplyMediumType.pm »
1 package Biblio::ILL::ISO::ShippedServiceType;
2  
3 =head1 NAME
4  
5 Biblio::ILL::ISO::ShippedServiceType
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::ShippedServiceType 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::HistoryReport
37  
38 =cut
39  
40 4 ▶BEGIN{@ISA = qw ( Biblio::ILL::ISO::ENUMERATED
Subroutine BEGIN: called CC=1 SCAR=0.0
41 Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype
42  
43 =head1 FROM THE ASN DEFINITION
44
45 Shipped-Service-Type ::= ILL-Service-Type -- (loan | copy-non-returnable)
46 -- subtype of ILL-Service-Type
47
48 which is:
49 ILL-Service-Type ::= ENUMERATED {
50 loan (1),
51 copy-non-returnable (2),
52 locations (3),
53 estimate (4),
54 responder-specific (5)
55 }
56  
57 Basically, I'm cheating here... I just created a new ENUM type
58 rather than inherit from ILLServiceType and add some constraints.
59
60 -David
61  
62 =cut
63  
64 =head1 METHODS
65  
66 =cut
67  
68 #---------------------------------------------------------------
69 #
70 #---------------------------------------------------------------
71 =head1
72  
73 =head2 new( $s )
74  
75 Creates a new ShippedServiceType object.
76 Valid paramaters are listed in the FROM THE ASN DEFINITION section
77 (e.g. "loan").
78  
79 =cut
80 5 ▶sub new {
Subroutine new: called CC=4 SCAR=14.8
Pod documented
81 5 my $class = shift;
82 5 my $self = {};
83  
84 5 $self->{"ENUM_LIST"} = {"loan" => 1,
85 "copy-non-returnable" => 2
86 };
87  
88 5 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 5 0 5
89 5 my $s = shift;
90
91 5 ▶ if ( exists $self->{"ENUM_LIST"}->{$s} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'ENUM_LIST'}{$s}) { } 5 0 5
92 5 $self->{"ENUMERATED"} = $self->{"ENUM_LIST"}->{$s};
93 } else {
94 0 croak "invalid ShippedServiceType: [$s]";
95 }
96 }
97  
98 5 ▶ bless($self, ref($class) || $class);
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
050
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
99 5 return ($self);
100 }
101  
102 =head1 SEE ALSO
103  
104 See the README for system design notes.
105 See the parent class(es) for other available methods.
106  
107 For more information on Interlibrary Loan standards (ISO 10160/10161),
108 a good place to start is:
109  
110 http://www.nlc-bnc.ca/iso/ill/main.htm
111  
112 =cut
113  
114 =head1 AUTHOR
115  
116 David Christensen, <DChristensenSPAMLESS@westman.wave.ca>
117  
118 =cut
119  
120  
121 =head1 COPYRIGHT AND LICENSE
122  
123 Copyright 2003 by David Christensen
124  
125 This library is free software; you can redistribute it and/or modify it
126 under the same terms as Perl itself.
127  
128 =cut
129  
130 4 1;
« lib/Biblio/ILL/ISO/ShippedConditions.pm ↑ Summary lib/Biblio/ILL/ISO/SupplyMediumType.pm »