lib/Biblio/ILL/ISO/SystemAddress.pm

filter: Statementstmt 55.5% 20 / 36 Branchbran 25.0% 1 / 4 Conditioncond 16.6% 1 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 62.5% 5 / 8 Podpod 100% 4 / 4 totaltotal 50.0% 31 / 62 CC 6 SCAR 20.1
CC
6
Cov
48%
from_asn
20.0
new
3.1
set_id
2.0
CRAP 7.5
« lib/Biblio/ILL/ISO/DeliveryAddress.pm ↑ Summary lib/Biblio/ILL/ISO/SystemId.pm »
1 package Biblio::ILL::ISO::SystemAddress;
2  
3 =head1 NAME
4  
5 Biblio::ILL::ISO::SystemAddress
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::ILLString;
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::SystemAddress is a derivation of Biblio::ILL::ISO::ILLASNtype.
29  
30 =head1 USES
31  
32 Biblio::ILL::ISO::ILLString
33  
34 =head1 USED IN
35  
36 Biblio::ILL::ISO::AlreadyForwarded
37 Biblio::ILL::ISO::DeliveryAddress
38 Biblio::ILL::ISO::EDeliveryDetails
39 Biblio::ILL::ISO::LocationInfo
40 Biblio::ILL::ISO::SendToListType
41 Biblio::ILL::ISO::ThirdPartyInfoType
42  
43 =cut
44  
45 4 ▶BEGIN{@ISA = qw ( Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype
Subroutine BEGIN: called CC=1 SCAR=0.0
46  
47 =head1 FROM THE ASN DEFINITION
48
49 System-Address ::= SEQUENCE {
50 telecom-service-identifier [0] ILL-String OPTIONAL,
51 telecom-service-address [1] ILL-String OPTIONAL
52 }
53  
54 =cut
55  
56 =head1 METHODS
57  
58 =cut
59  
60 #---------------------------------------------------------------
61 #
62 #---------------------------------------------------------------
63 =head1
64  
65 =head2 new( $telecom_service_identifier, $telecom_service_address )
66  
67 Creates a new SystemAddress object.
68 Expects a telecom-service-identifier (Biblio::ILL::ISO::ILLString), and
69 a telecom-service-address (Biblio::ILL::ISO::ILLString).
70  
71 =cut
72 16 ▶sub new {
Subroutine new: called CC=3 SCAR=11.3
Pod documented
73 16 my $class = shift;
74 16 my $self = {};
75  
76 16 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 16 0 16
77 16 my ($id, $addr) = @_;
78 16 $self->{"telecom-service-identifier"} = new Biblio::ILL::ISO::ILLString($id);
79 16 $self->{"telecom-service-address"} = new Biblio::ILL::ISO::ILLString($addr);
80 }
81 16 ▶ bless($self, ref($class) || $class);
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
0160
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
82 16 return ($self);
83 }
84  
85  
86 #---------------------------------------------------------------
87 #
88 #---------------------------------------------------------------
89 =head1
90  
91 =head2 set_id( $telecom_service_identifier )
92  
93 Sets the object's telecom-service-identifier.
94 Expects a valid Biblio::ILL::ISO::ILLString.
95  
96 =cut
97 0 ▶sub set_id {
Subroutine set_id: not called CC=1 SCAR=6.9
Pod documented
98 0 my $self = shift;
99 0 my ($s) = @_;
100  
101 0 $self->{"telecom-service-identifier"} = new Biblio::ILL::ISO::ILLString($s);
102 0 return;
103 }
104  
105 #---------------------------------------------------------------
106 #
107 #---------------------------------------------------------------
108 =head1
109  
110 =head2 set_address( $telecom_service_address )
111  
112 Sets the object's telecom-service-address.
113 Expects a valid Biblio::ILL::ISO::ILLString.
114  
115 =cut
116 0 ▶sub set_address {
Subroutine set_address: not called CC=1 SCAR=6.9
Pod documented
117 0 my $self = shift;
118 0 my ($s) = @_;
119  
120 0 $self->{"telecom-service-address"} = new Biblio::ILL::ISO::ILLString($s);
121 0 return;
122 }
123  
124 #---------------------------------------------------------------
125 #
126 #---------------------------------------------------------------
127 =head1
128  
129 =head2 from_asn($href)
130  
131 Given a properly formatted hash, builds the object.
132  
133 =cut
134 0 ▶sub from_asn {
Subroutine from_asn: not called CC=4 SCAR=30.0
Pod documented
135 0 my $self = shift;
136 0 my $href = shift;
137  
138 0 foreach my $k (keys %$href) {
139 #print ref($self) . "...$k\n";
140  
141 0 ▶ if (($k =~ /^telecom-service-identifier$/)
Branch: 1 branch
BranchTrueFalseTotal
if ($k =~ /^telecom-service-identifier$/ or $k =~ /^telecom-service-address$/) { } 0 0 0
Condition0%0/3
$k =~ /^telecom-service-identifier$/ or $k =~ /^telecom-service-address$/
l!l&&r!l&&!r
000
MC/DC0%0/2
$k =~ /^telecom-service-identifier$/ or $k =~ /^telecom-service-address$/
$k =~ /^telecom-service-identifier$/ $k =~ /^telecom-service-address$/
Truth table0%0/3
A or B
A= $k =~ /^telecom-service-identifier$/B= $k =~ /^telecom-service-address$/
ABresult
1X1
011
000
142 || ($k =~ /^telecom-service-address$/)
143 ) {
144 0 $self->{$k} = new Biblio::ILL::ISO::ILLString();
145 0 $self->{$k}->from_asn($href->{$k});
146  
147 } else {
148 0 croak "invalid " . ref($self) . " element: [$k]";
149 }
150 }
151  
152 0 return $self;
153 }
154  
155 =head1 SEE ALSO
156  
157 See the README for system design notes.
158 See the parent class(es) for other available methods.
159  
160 For more information on Interlibrary Loan standards (ISO 10160/10161),
161 a good place to start is:
162  
163 http://www.nlc-bnc.ca/iso/ill/main.htm
164  
165 =cut
166  
167 =head1 AUTHOR
168  
169 David Christensen, <DChristensenSPAMLESS@westman.wave.ca>
170  
171 =cut
172  
173  
174 =head1 COPYRIGHT AND LICENSE
175  
176 Copyright 2003 by David Christensen
177  
178 This library is free software; you can redistribute it and/or modify it
179 under the same terms as Perl itself.
180  
181 =cut
182  
183 4 1;
« lib/Biblio/ILL/ISO/DeliveryAddress.pm ↑ Summary lib/Biblio/ILL/ISO/SystemId.pm »