lib/Biblio/ILL/ISO/SupplyDetails.pm

filter: Statementstmt 36.1% 60 / 166 Branchbran 16.3% 19 / 116 Conditioncond 11.1% 2 / 18 MC/DCmcdc 0.0% 0 / 11 Subroutinesub 47.6% 10 / 21 Podpod 100% 12 / 12 totaltotal 29.9% 103 / 344 CC 66 SCAR 48.7
CC
66
Cov
27%
set
462.0
new
41.3
from_asn
30.0
CRAP 130.0
« lib/Biblio/ILL/ISO/ItemId.pm ↑ Summary lib/Biblio/ILL/ISO/WillSupplyResults.pm »
1 package Biblio::ILL::ISO::SupplyDetails;
2  
3 =head1 NAME
4  
5 Biblio::ILL::ISO::SupplyDetails
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 4 ▶use Biblio::ILL::ISO::DateDue;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use Biblio::ILL::ISO::Amount;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 4 ▶use Biblio::ILL::ISO::ShippedConditions;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 4 ▶use Biblio::ILL::ISO::ShippedVia;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 4 ▶use Biblio::ILL::ISO::UnitsPerMediumTypeSequence;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19 =head1 VERSION
20  
21 Version 0.01
22  
23 =cut
24 4 our $VERSION = '0.01';
25 #---------------------------------------------------------------------------
26 # Mods
27 # 0.01 - 2003.08.11 - original version
28 #---------------------------------------------------------------------------
29  
30 =head1 DESCRIPTION
31  
32 Biblio::ILL::ISO::SupplyDetails is a derivation of Biblio::ILL::ISO::ILLASNtype.
33  
34 =head1 USES
35  
36 Biblio::ILL::ISO::ILLString
37 Biblio::ILL::ISO::DateDue
38 Biblio::ILL::ISO::Amount
39 Biblio::ILL::ISO::ShippedConditions
40 Biblio::ILL::ISO::ShippedVia
41 Biblio::ILL::ISO::UnitsPerMediumTypeSequence
42  
43 =head1 USED IN
44  
45 Biblio::ILL::ISO::Shipped
46  
47 =cut
48  
49 4 ▶BEGIN{@ISA = qw ( Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype
Subroutine BEGIN: called CC=1 SCAR=0.0
50  
51 =head1 FROM THE ASN DEFINITION
52
53 Supply-Details ::= EXPLICIT SEQUENCE {
54 date-shipped [0] IMPLICIT ISO-Date OPTIONAL,
55 date-due [1] IMPLICIT Date-Due OPTIONAL,
56 chargeable-units [2] IMPLICIT INTEGER OPTIONAL, -- (1..9999)
57 cost [3] IMPLICIT Amount OPTIONAL,
58 shipped-conditions [4] IMPLICIT Shipped-Conditions OPTIONAL,
59 shipped-via Shipped-Via OPTIONAL,
60 -- electronic-delivery may only be present in APDUs with a
61 -- protocol-version-num value of 2 or greater
62 insured-for [6] IMPLICIT Amount OPTIONAL,
63 return-insurance-require [7] IMPLICIT Amount OPTIONAL,
64 no-of-units-per-medium [8] IMPLICIT SEQUENCE OF Units-Per-Medium-Type OPTIONAL
65 }
66  
67 =cut
68  
69 =head1 METHODS
70  
71 =cut
72  
73 #---------------------------------------------------------------
74 #
75 #---------------------------------------------------------------
76 =head1
77  
78 =head2 new( $date_shipped,$date_due, $chargeable_units, $cost, $shipped_conditions, $shipped_via, $insured_for, $return_insurance_require, $no_of_units_per_medium )
79  
80 Creates a new SupplyDetails object.
81 Expects (optionally) date-shipped (Biblio::ILL::ISO::ISODate or text string YYYYMMDD),
82 (optionally) date-due (Biblio::ILL::ISO::ISODate or text string YYYYMMDD),
83 (optionally) chargeable-units (integer),
84 (optionally) cost (Biblio::ILL::ISO::Amount or text string),
85 (optionally) shipped-conditions (Biblio::ILL::ISO::ShippedConditions),
86 (optionally) shipped-via (Biblio::ILL::ISO::ShippedVia),
87 (optionally) insured-for (Biblio::ILL::ISO::Amount or text string),
88 (optionally) return-insurance-require (Biblio::ILL::ISO::Amount or text string),
89 (optionally) no-of-units-per-medium (Biblio::ILL::ISO::UnitsPerMediumTypeSequence).
90  
91 Pass empty strings ("") as placeholders.
92  
93 =cut
94 2 ▶sub new {
Subroutine new: called CC=22 SCAR=37.2
Pod documented
95 2 my $class = shift;
96 2 my $self = {};
97  
98 2 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 2 0 2
99 2 my ($date_shipped, $date_due, $chargeable_units, $cost,
100 $shipped_conditions, $shipped_via, $insured_for,
101 $return_insurance_require, $no_of_units_per_medium) = @_;
102
103 2 ▶ if ($date_shipped) {
Branch: 1 branch
BranchTrueFalseTotal
if ($date_shipped) 2 0 2
104 2 ▶ if (ref($date_shipped) eq "Biblio::ILL::ISO::ISODate") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $date_shipped eq 'Biblio::ILL::ISO::ISODate') { } 0 2 2
105 0 $self->{"date-shipped"} = $date_shipped;
106 } else {
107 # assume it's in text format (ISODate will tell you if it's not)
108 2 $self->{"date-shipped"} = new Biblio::ILL::ISO::ISODate($date_shipped);
109 }
110 }
111  
112 2 ▶ if ($date_due) {
Branch: 1 branch
BranchTrueFalseTotal
if ($date_due) 2 0 2
113 2 ▶ if (ref($date_due) eq "Biblio::ILL::ISO::DateDue") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $date_due eq 'Biblio::ILL::ISO::DateDue') { } 0 2 2
114 0 $self->{"date-due"} = $date_due;
115 } else {
116 # assume it's in text format (DateDue will tell you if it's not)
117 # also assume it's renewable.
118 2 $self->{"date-due"} = new Biblio::ILL::ISO::DateDue($date_due,"true");
119 }
120 }
121  
122 2 ▶ if ($chargeable_units) {
Branch: 1 branch
BranchTrueFalseTotal
if ($chargeable_units) 2 0 2
123 2 ▶ croak "invalid chargeable-units" unless (($chargeable_units > 0) && ($chargeable_units <= 9999));
Branch: 1 branch
BranchTrueFalseTotal
unless $chargeable_units > 0 and $chargeable_units <= 9999 0 2 2
Condition33%1/3
$chargeable_units > 0 and $chargeable_units <= 9999
!ll&&!rl&&r
002
MC/DC0%0/2
$chargeable_units > 0 and $chargeable_units <= 9999
$chargeable_units > 0 $chargeable_units <= 9999
Truth table33%1/3
A and B
A= $chargeable_units > 0B= $chargeable_units <= 9999
ABresult
0X0
100
111
124 2 $self->{"chargeable-units"} = $chargeable_units;
125 }
126  
127 2 ▶ if ($cost) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cost) 2 0 2
128 2 ▶ if (ref($cost) eq "Biblio::ILL::ISO::Amount") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $cost eq 'Biblio::ILL::ISO::Amount') { } 0 2 2
129 0 $self->{"cost"} = $cost;
130 } else {
131 # assume it's in text format (Amount will tell you if it's not)
132 2 $self->{"cost"} = new Biblio::ILL::ISO::Amount($cost);
133 }
134 }
135  
136 2 ▶ if ($shipped_conditions) {
Branch: 1 branch
BranchTrueFalseTotal
if ($shipped_conditions) 2 0 2
137 2 ▶ croak "invalid shipped-conditions" unless (ref($shipped_conditions) eq "Biblio::ILL::ISO::ShippedConditions");
Branch: 1 branch
BranchTrueFalseTotal
unless ref $shipped_conditions eq "Biblio::ILL::ISO::ShippedConditions" 0 2 2
138 2 $self->{"shipped-conditions"} = $shipped_conditions;
139 }
140  
141 2 ▶ if ($shipped_via) {
Branch: 1 branch
BranchTrueFalseTotal
if ($shipped_via) 2 0 2
142 2 ▶ croak "invalid shipped-via" unless (ref($shipped_via) eq "Biblio::ILL::ISO::ShippedVia");
Branch: 1 branch
BranchTrueFalseTotal
unless ref $shipped_via eq "Biblio::ILL::ISO::ShippedVia" 0 2 2
143 2 $self->{"shipped-via"} = $shipped_via;
144 }
145  
146 2 ▶ if ($insured_for) {
Branch: 1 branch
BranchTrueFalseTotal
if ($insured_for) 2 0 2
147 2 ▶ if (ref($insured_for) eq "Biblio::ILL::ISO::Amount") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $insured_for eq 'Biblio::ILL::ISO::Amount') { } 2 0 2
148 2 $self->{"insured_for"} = $insured_for;
149 } else {
150 # assume it's in text format (Amount will tell you if it's not)
151 0 $self->{"insured-for"} = new Biblio::ILL::ISO::Amount($insured_for);
152 }
153 }
154  
155 2 ▶ if ($return_insurance_require) {
Branch: 1 branch
BranchTrueFalseTotal
if ($return_insurance_require) 2 0 2
156 2 ▶ if (ref($return_insurance_require) eq "Biblio::ILL::ISO::Amount") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $return_insurance_require eq 'Biblio::ILL::ISO::Amount') { } 0 2 2
157 0 $self->{"return-insurance-require"} = $return_insurance_require;
158 } else {
159 # assume it's in text format (Amount will tell you if it's not)
160 2 $self->{"return-insurance-require"} = new Biblio::ILL::ISO::Amount($return_insurance_require);
161 }
162 }
163  
164 2 ▶ if ($no_of_units_per_medium) {
Branch: 1 branch
BranchTrueFalseTotal
if ($no_of_units_per_medium) 2 0 2
165 2 ▶ croak "invalid no-of-units-per-medium" unless (ref($no_of_units_per_medium) eq "Biblio::ILL::ISO::UnitsPerMediumTypeSequence");
Branch: 1 branch
BranchTrueFalseTotal
unless ref $no_of_units_per_medium eq "Biblio::ILL::ISO::UnitsPerMediumTypeSequence" 0 2 2
166 2 $self->{"no-of-units-per-medium"} = $no_of_units_per_medium;
167 }
168 }
169  
170 2 ▶ bless($self, ref($class) || $class);
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
020
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
171 2 return ($self);
172 }
173  
174  
175 #---------------------------------------------------------------
176 #
177 #---------------------------------------------------------------
178 =head1
179  
180 =head2 set( $date_shipped, $date_due, $chargeable_units, $cost, $shipped_conditions, $shipped_via, $insured_for, $return_insurance_require, $no_of_units_per_medium )
181  
182 Sets the object's fields:
183 (optionally) date-shipped (Biblio::ILL::ISO::ISODate or text string YYYYMMDD),
184 (optionally) date-due (Biblio::ILL::ISO::ISODate or text string YYYYMMDD),
185 (optionally) chargeable-units (integer),
186 (optionally) cost (Biblio::ILL::ISO::Amount or text string),
187 (optionally) shipped-conditions (Biblio::ILL::ISO::ShippedConditions),
188 (optionally) shipped-via (Biblio::ILL::ISO::ShippedVia),
189 (optionally) insured-for (Biblio::ILL::ISO::Amount or text string),
190 (optionally) return-insurance-require (Biblio::ILL::ISO::Amount or text string),
191 (optionally) no-of-units-per-medium (Biblio::ILL::ISO::UnitsPerMediumTypeSequence).
192  
193 Pass empty strings ("") as placeholders.
194  
195 =cut
196 0 ▶sub set {
Subroutine set: not called CC=21 SCAR=61.4
Pod documented
197 0 my $self = shift;
198 0 my ($date_shipped, $date_due, $chargeable_units, $cost,
199 $shipped_conditions, $shipped_via, $insured_for,
200 $return_insurance_require, $no_of_units_per_medium) = @_;
201
202 0 ▶ if ($date_shipped) {
Branch: 1 branch
BranchTrueFalseTotal
if ($date_shipped) 0 0 0
203 0 ▶ if (ref($date_shipped) eq "Biblio::ILL::ISO::ISODate") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $date_shipped eq 'Biblio::ILL::ISO::ISODate') { } 0 0 0
204 0 $self->{"date-shipped"} = $date_shipped;
205 } else {
206 # assume it's in text format (ISODate will tell you if it's not)
207 0 ▶ $self->{"date-shipped"} = new Biblio::ILL::ISO::ISODate($date_shipped) if ($date_shipped);
Branch: 1 branch
BranchTrueFalseTotal
if $date_shipped 0 0 0
208 }
209 }
210
211 0 ▶ if ($date_due) {
Branch: 1 branch
BranchTrueFalseTotal
if ($date_due) 0 0 0
212 0 ▶ if (ref($date_due) eq "Biblio::ILL::ISO::DateDue") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $date_due eq 'Biblio::ILL::ISO::DateDue') { } 0 0 0
213 0 $self->{"date-due"} = $date_due;
214 } else {
215 # assume it's in text format (DateDue will tell you if it's not)
216 # also assume it's renewable.
217 0 $self->{"date-due"} = new Biblio::ILL::ISO::DateDue($date_due,"true");
218 }
219 }
220  
221 0 ▶ if ($chargeable_units) {
Branch: 1 branch
BranchTrueFalseTotal
if ($chargeable_units) 0 0 0
222 0 ▶ croak "invalid chargeable-units" unless (($chargeable_units > 0) && ($chargeable_units <= 9999));
Branch: 1 branch
BranchTrueFalseTotal
unless $chargeable_units > 0 and $chargeable_units <= 9999 0 0 0
Condition0%0/3
$chargeable_units > 0 and $chargeable_units <= 9999
!ll&&!rl&&r
000
MC/DC0%0/2
$chargeable_units > 0 and $chargeable_units <= 9999
$chargeable_units > 0 $chargeable_units <= 9999
Truth table0%0/3
A and B
A= $chargeable_units > 0B= $chargeable_units <= 9999
ABresult
0X0
100
111
223 0 $self->{"chargeable-units"} = $chargeable_units;
224 }
225
226 0 ▶ if ($cost) {
Branch: 1 branch
BranchTrueFalseTotal
if ($cost) 0 0 0
227 0 ▶ if (ref($cost) eq "Biblio::ILL::ISO::Amount") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $cost eq 'Biblio::ILL::ISO::Amount') { } 0 0 0
228 0 $self->{"cost"} = $cost;
229 } else {
230 # assume it's in text format (Amount will tell you if it's not)
231 0 $self->{"cost"} = new Biblio::ILL::ISO::Amount($cost);
232 }
233 }
234
235 0 ▶ if ($shipped_conditions) {
Branch: 1 branch
BranchTrueFalseTotal
if ($shipped_conditions) 0 0 0
236 0 ▶ croak "invalid shipped-conditions" unless (ref($shipped_conditions) eq "Biblio::ILL::ISO::ShippedConditions");
Branch: 1 branch
BranchTrueFalseTotal
unless ref $shipped_conditions eq "Biblio::ILL::ISO::ShippedConditions" 0 0 0
237 0 $self->{"shipped-conditions"} = $shipped_conditions;
238 }
239
240 0 ▶ if ($shipped_via) {
Branch: 1 branch
BranchTrueFalseTotal
if ($shipped_via) 0 0 0
241 0 ▶ croak "invalid shipped-via" unless (ref($shipped_via) eq "Biblio::ILL::ISO::ShippedVia");
Branch: 1 branch
BranchTrueFalseTotal
unless ref $shipped_via eq "Biblio::ILL::ISO::ShippedVia" 0 0 0
242 0 $self->{"shipped-via"} = $shipped_via;
243 }
244
245 0 ▶ if ($insured_for) {
Branch: 1 branch
BranchTrueFalseTotal
if ($insured_for) 0 0 0
246 0 ▶ if (ref($insured_for) eq "Biblio::ILL::ISO::Amount") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $insured_for eq 'Biblio::ILL::ISO::Amount') { } 0 0 0
247 0 $self->{"insured_for"} = $insured_for;
248 } else {
249 # assume it's in text format (Amount will tell you if it's not)
250 0 $self->{"insured-for"} = new Biblio::ILL::ISO::Amount($insured_for);
251 }
252 }
253
254 0 ▶ if ($return_insurance_require) {
Branch: 1 branch
BranchTrueFalseTotal
if ($return_insurance_require) 0 0 0
255 0 ▶ if (ref($return_insurance_require) eq "Biblio::ILL::ISO::Amount") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $return_insurance_require eq 'Biblio::ILL::ISO::Amount') { } 0 0 0
256 0 $self->{"return-insurance-require"} = $return_insurance_require;
257 } else {
258 # assume it's in text format (Amount will tell you if it's not)
259 0 $self->{"return-insurance-require"} = new Biblio::ILL::ISO::Amount($return_insurance_require);
260 }
261 }
262
263 0 ▶ if ($no_of_units_per_medium) {
Branch: 1 branch
BranchTrueFalseTotal
if ($no_of_units_per_medium) 0 0 0
264 0 ▶ croak "invalid no-of-units-per-medium" unless (ref($no_of_units_per_medium) eq "Biblio::ILL::ISO::UnitsPerMediumTypeSequence");
Branch: 1 branch
BranchTrueFalseTotal
unless ref $no_of_units_per_medium eq "Biblio::ILL::ISO::UnitsPerMediumTypeSequence" 0 0 0
265 0 $self->{"no-of-units-per-medium"} = $no_of_units_per_medium;
266 }
267
268 0 return;
269 }
270  
271 #---------------------------------------------------------------
272 #
273 #---------------------------------------------------------------
274 =head1
275  
276 =head2 from_asn($href)
277  
278 Given a properly formatted hash, builds the object.
279  
280 =cut
281 0 ▶sub from_asn {
Subroutine from_asn: not called CC=5 SCAR=34.0
Pod documented
282 0 my $self = shift;
283 0 my $href = shift;
284  
285 0 foreach my $k (keys %$href) {
286 #print ref($self) . "...$k\n";
287  
288 0 ▶ if (($k =~ /^client-name$/)
Branch: 1 branch
BranchTrueFalseTotal
if ($k =~ /^client-name$/ or $k =~ /^client-status$/ or $k =~ /^client-identifier$/) { } 0 0 0
Condition0%0/6
$k =~ /^client-name$/ or $k =~ /^client-status$/ or $k =~ /^client-identifier$/
l!l&&r!l&&!r
000
$k =~ /^client-name$/ or $k =~ /^client-status$/
l!l&&r!l&&!r
000
MC/DC0%0/3
$k =~ /^client-name$/ or $k =~ /^client-status$/ or $k =~ /^client-identifier$/
$k =~ /^client-name$/ $k =~ /^client-status$/ $k =~ /^client-identifier$/
Truth table0%0/4
A or B or C
A= $k =~ /^client-name$/B= $k =~ /^client-status$/C= $k =~ /^client-identifier$/
ABCresult
1XX1
01X1
0011
0000
289 || ($k =~ /^client-status$/)
290 || ($k =~ /^client-identifier$/)
291 ) {
292 0 $self->{$k} = new Biblio::ILL::ISO::ILLString();
293 0 $self->{$k}->from_asn($href->{$k});
294
295 } else {
296 0 croak "invalid " . ref($self) . " element: [$k]";
297 }
298  
299 }
300 0 return $self;
301 }
302  
303  
304 #---------------------------------------------------------------
305 #
306 #---------------------------------------------------------------
307 =head1
308  
309 =head2 set_date_shipped( $dt )
310  
311 Sets the object's date-shipped.
312 Expects a valid Biblio::ILL::ISO::ISODate or a properly formattted text string (YYYYMMDD).
313  
314 =cut
315 0 ▶sub set_date_shipped {
Subroutine set_date_shipped: not called CC=4 SCAR=30.0
Pod documented
316 0 my $self = shift;
317 0 my ($date_shipped) = @_;
318
319 0 ▶ croak "missing date-shipped" unless ($date_shipped);
Branch: 1 branch
BranchTrueFalseTotal
unless $date_shipped 0 0 0
320 0 ▶ if (ref($date_shipped) eq "Biblio::ILL::ISO::ISODate") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $date_shipped eq 'Biblio::ILL::ISO::ISODate') { } 0 0 0
321 0 $self->{"date-shipped"} = $date_shipped;
322 } else {
323 # assume it's in text format (ISODate will tell you if it's not)
324 0 ▶ $self->{"date-shipped"} = new Biblio::ILL::ISO::ISODate($date_shipped) if ($date_shipped);
Branch: 1 branch
BranchTrueFalseTotal
if $date_shipped 0 0 0
325 }
326
327 0 return;
328 }
329  
330 #---------------------------------------------------------------
331 #
332 #---------------------------------------------------------------
333 =head1
334  
335 =head2 set_date_due( $dt )
336  
337 Sets the object's date-due.
338 Expects a valid Biblio::ILL::ISO::ISODate or a properly formattted text string (YYYYMMDD).
339  
340 =cut
341 0 ▶sub set_date_due {
Subroutine set_date_due: not called CC=3 SCAR=24.8
Pod documented
342 0 my $self = shift;
343 0 my ($date_due) = @_;
344
345 0 ▶ croak "missing date-due" unless ($date_due);
Branch: 1 branch
BranchTrueFalseTotal
unless $date_due 0 0 0
346 0 ▶ croak "invalid date-due" unless (ref($date_due) eq "Biblio::ILL::ISO::DateDue");
Branch: 1 branch
BranchTrueFalseTotal
unless ref $date_due eq "Biblio::ILL::ISO::DateDue" 0 0 0
347 0 $self->{"date-due"} = $date_due;
348 0 return;
349 }
350  
351 #---------------------------------------------------------------
352 #
353 #---------------------------------------------------------------
354 =head1
355  
356 =head2 set_chargeable_units( $cu )
357  
358 Sets the object's chargeable-units.
359 Expects an integer (1-9999).
360  
361 =cut
362 0 ▶sub set_chargeable_units {
Subroutine set_chargeable_units: not called CC=4 SCAR=30.0
Pod documented
363 0 my $self = shift;
364 0 my ($chargeable_units) = @_;
365
366 0 ▶ croak "missing chargeable-units" unless ($chargeable_units);
Branch: 1 branch
BranchTrueFalseTotal
unless $chargeable_units 0 0 0
367 0 ▶ croak "invalid chargeable-units" unless (($chargeable_units > 0) && ($chargeable_units <= 9999));
Branch: 1 branch
BranchTrueFalseTotal
unless $chargeable_units > 0 and $chargeable_units <= 9999 0 0 0
Condition0%0/3
$chargeable_units > 0 and $chargeable_units <= 9999
!ll&&!rl&&r
000
MC/DC0%0/2
$chargeable_units > 0 and $chargeable_units <= 9999
$chargeable_units > 0 $chargeable_units <= 9999
Truth table0%0/3
A and B
A= $chargeable_units > 0B= $chargeable_units <= 9999
ABresult
0X0
100
111
368 0 $self->{"chargeable-units"} = $chargeable_units;
369 0 return;
370 }
371  
372 #---------------------------------------------------------------
373 #
374 #---------------------------------------------------------------
375 =head1
376  
377 =head2 set_cost( $cost )
378  
379 Sets the object's cost.
380 Expects a valid Biblio::ILL::ISO::Amount or a text string.
381  
382 =cut
383 0 ▶sub set_cost {
Subroutine set_cost: not called CC=3 SCAR=24.8
Pod documented
384 0 my $self = shift;
385 0 my ($cost) = @_;
386
387 0 ▶ croak "missing cost" unless ($cost);
Branch: 1 branch
BranchTrueFalseTotal
unless $cost 0 0 0
388 0 ▶ if (ref($cost) eq "Biblio::ILL::ISO::Amount") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $cost eq 'Biblio::ILL::ISO::Amount') { } 0 0 0
389 0 $self->{"cost"} = $cost;
390 } else {
391 # assume it's in text format (Amount will tell you if it's not)
392 0 $self->{"cost"} = new Biblio::ILL::ISO::Amount($cost);
393 }
394 0 return;
395 }
396  
397 #---------------------------------------------------------------
398 #
399 #---------------------------------------------------------------
400 =head1
401  
402 =head2 set_shipped_conditions( $sc )
403  
404 Sets the object's shipped-conditions.
405 Expects a valid Biblio::ILL::ISO::ShippedConditions.
406  
407 =cut
408 0 ▶sub set_shipped_conditions {
Subroutine set_shipped_conditions: not called CC=3 SCAR=24.8
Pod documented
409 0 my $self = shift;
410 0 my ($shipped_conditions) = @_;
411
412 0 ▶ croak "missing shipped-conditions" unless ($shipped_conditions);
Branch: 1 branch
BranchTrueFalseTotal
unless $shipped_conditions 0 0 0
413 0 ▶ croak "invalid shipped-conditions" unless (ref($shipped_conditions) eq "Biblio::ILL::ISO::ShippedConditions");
Branch: 1 branch
BranchTrueFalseTotal
unless ref $shipped_conditions eq "Biblio::ILL::ISO::ShippedConditions" 0 0 0
414 0 $self->{"shipped-conditions"} = $shipped_conditions;
415 0 return;
416 }
417  
418 #---------------------------------------------------------------
419 #
420 #---------------------------------------------------------------
421 =head1
422  
423 =head2 set_shipped_via( $sv )
424  
425 Sets the object's shipped-via.
426 Expects a valid Biblio::ILL::ISO::ShippedVia.
427  
428 =cut
429 0 ▶sub set_shipped_via {
Subroutine set_shipped_via: not called CC=3 SCAR=24.8
Pod documented
430 0 my $self = shift;
431 0 my ($shipped_via) = @_;
432
433 0 ▶ croak "missing shipped-via" unless ($shipped_via);
Branch: 1 branch
BranchTrueFalseTotal
unless $shipped_via 0 0 0
434 0 ▶ croak "invalid shipped-via" unless (ref($shipped_via) eq "Biblio::ILL::ISO::ShippedVia");
Branch: 1 branch
BranchTrueFalseTotal
unless ref $shipped_via eq "Biblio::ILL::ISO::ShippedVia" 0 0 0
435 0 $self->{"shipped-via"} = $shipped_via;
436 0 return;
437 }
438  
439 #---------------------------------------------------------------
440 #
441 #---------------------------------------------------------------
442 =head1
443  
444 =head2 set_insured_for( $insured_amount )
445  
446 Sets the object's insured-for.
447 Expects a valid Biblio::ILL::ISO::Amount or a text string.
448  
449 =cut
450 0 ▶sub set_insured_for {
Subroutine set_insured_for: not called CC=3 SCAR=24.8
Pod documented
451 0 my $self = shift;
452 0 my ($insured_for) = @_;
453
454 0 ▶ croak "missing insured-for" unless ($insured_for);
Branch: 1 branch
BranchTrueFalseTotal
unless $insured_for 0 0 0
455 0 ▶ if (ref($insured_for) eq "Biblio::ILL::ISO::Amount") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $insured_for eq 'Biblio::ILL::ISO::Amount') { } 0 0 0
456 0 $self->{"insured_for"} = $insured_for;
457 } else {
458 # assume it's in text format (Amount will tell you if it's not)
459 0 $self->{"insured-for"} = new Biblio::ILL::ISO::Amount($insured_for);
460 }
461 0 return;
462 }
463  
464 #---------------------------------------------------------------
465 #
466 #---------------------------------------------------------------
467 =head1
468  
469 =head2 set_return_insurance_require( $insurance_required_amount )
470  
471 Sets the object's return-insurance-require.
472 Expects a valid Biblio::ILL::ISO::Amount or a text string.
473  
474 =cut
475 0 ▶sub set_return_insurance_require {
Subroutine set_return_insurance_require: not called CC=3 SCAR=24.8
Pod documented
476 0 my $self = shift;
477 0 my ($return_insurance_require) = @_;
478
479 0 ▶ croak "missing return-insurance-require" unless ($return_insurance_require);
Branch: 1 branch
BranchTrueFalseTotal
unless $return_insurance_require 0 0 0
480 0 ▶ if (ref($insured_for) eq "Biblio::ILL::ISO::Amount") {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $insured_for eq 'Biblio::ILL::ISO::Amount') { } 0 0 0
481 0 $self->{"return-insurance-require"} = $return_insurance_require;
482 } else {
483 # assume it's in text format (Amount will tell you if it's not)
484 0 $self->{"return-insurance-require"} = new Biblio::ILL::ISO::Amount($return_insurance_requre);
485 }
486 0 return;
487 }
488  
489 #---------------------------------------------------------------
490 #
491 #---------------------------------------------------------------
492 =head1
493  
494 =head2 set_no_of_units_per_medium( $units )
495  
496 Sets the object's no-of-units-per-medium.
497 Expects a valid Biblio::ILL::ISO::UnitsPerMediumType.
498  
499 =cut
500 0 ▶sub set_no_of_units_per_medium {
Subroutine set_no_of_units_per_medium: not called CC=3 SCAR=24.8
Pod documented
501 0 my $self = shift;
502 0 my ($no_of_units_per_medium) = @_;
503
504 0 ▶ croak "missing no-of-units-per-medium" unless ($no_of_units_per_medium);
Branch: 1 branch
BranchTrueFalseTotal
unless $no_of_units_per_medium 0 0 0
505 0 ▶ croak "invalid no-of-units-per-medium" unless (ref($no_of_units_per_medium) eq "Biblio::ILL::ISO::UnitsPerMediumType");
Branch: 1 branch
BranchTrueFalseTotal
unless ref $no_of_units_per_medium eq "Biblio::ILL::ISO::UnitsPerMediumType" 0 0 0
506 0 $self->{"no-of-units-per-medium"} = $no_of_units_per_medium;
507
508 0 return;
509 }
510  
511 =head1 SEE ALSO
512  
513 See the README for system design notes.
514 See the parent class(es) for other available methods.
515  
516 For more information on Interlibrary Loan standards (ISO 10160/10161),
517 a good place to start is:
518  
519 http://www.nlc-bnc.ca/iso/ill/main.htm
520  
521 =cut
522  
523 =head1 AUTHOR
524  
525 David Christensen, <DChristensenSPAMLESS@westman.wave.ca>
526  
527 =cut
528  
529  
530 =head1 COPYRIGHT AND LICENSE
531  
532 Copyright 2003 by David Christensen
533  
534 This library is free software; you can redistribute it and/or modify it
535 under the same terms as Perl itself.
536  
537 =cut
538  
539 4 1;
« lib/Biblio/ILL/ISO/ItemId.pm ↑ Summary lib/Biblio/ILL/ISO/WillSupplyResults.pm »