| 1 | package Biblio::ILL::ISO::HoldPlacedResults; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | =head1 NAME | ||||||||||||||||||||
| 4 | |||||||||||||||||||||
| 5 | Biblio::ILL::ISO::HoldPlacedResults | ||||||||||||||||||||
| 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::ISODate; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 4 | ▶ | use Biblio::ILL::ISO::MediumType; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | 4 | ▶ | use Biblio::ILL::ISO::LocationInfoSequence; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 4 | ▶ | use Carp; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | =head1 VERSION | ||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | Version 0.01 | ||||||||||||||||||||
| 19 | |||||||||||||||||||||
| 20 | =cut | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 4 | our $VERSION = '0.01'; | |||||||||||||||||||
| 23 | #--------------------------------------------------------------------------- | ||||||||||||||||||||
| 24 | # Mods | ||||||||||||||||||||
| 25 | # 0.01 - 2003.07.26 - original version | ||||||||||||||||||||
| 26 | #--------------------------------------------------------------------------- | ||||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | =head1 DESCRIPTION | ||||||||||||||||||||
| 29 | |||||||||||||||||||||
| 30 | Biblio::ILL::ISO::HoldPlacedResults is a derivation of Biblio::ILL::ISO::ILLASNtype. | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | =head1 USES | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | Biblio::ILL::ISO::ISODate; | ||||||||||||||||||||
| 35 | Biblio::ILL::ISO::MediumType; | ||||||||||||||||||||
| 36 | Biblio::ILL::ISO::LocationInfoSequence; | ||||||||||||||||||||
| 37 | |||||||||||||||||||||
| 38 | =head1 USED IN | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | Biblio::ILL::ISO::ResultsExplanation | ||||||||||||||||||||
| 41 | |||||||||||||||||||||
| 42 | =cut | ||||||||||||||||||||
| 43 | |||||||||||||||||||||
| 44 | 4 | ▶ | BEGIN{@ISA = qw ( Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 45 | |||||||||||||||||||||
| 46 | =head1 FROM THE ASN DEFINITION | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | Hold-Placed-Results ::= EXPLICIT SEQUENCE { | ||||||||||||||||||||
| 49 | estimated-date-available [0] IMPLICIT ISO-Date, | ||||||||||||||||||||
| 50 | hold-placed-medium-type [1] IMPLICIT Medium-Type OPTIONAL, | ||||||||||||||||||||
| 51 | locations [2] IMPLICIT SEQUENCE OF Location-Info OPTIONAL | ||||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | =cut | ||||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | =head1 METHODS | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | =cut | ||||||||||||||||||||
| 59 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 60 | # | ||||||||||||||||||||
| 61 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 62 | =head1 | ||||||||||||||||||||
| 63 | |||||||||||||||||||||
| 64 | =head2 new( $estimated_date_available [,$medium] [,$locations] ) | ||||||||||||||||||||
| 65 | |||||||||||||||||||||
| 66 | Creates a new HoldPlacedResults object. | ||||||||||||||||||||
| 67 | Expects an estimated-date-available (Biblio::ILL::ISO::ISODate), | ||||||||||||||||||||
| 68 | (optionally) a hold-placed-medium-type (Biblio::ILL::ISO::MediumType), and | ||||||||||||||||||||
| 69 | (optionally) a locations sequence (Biblio::ILL::ISO::LocationInfoSequence). | ||||||||||||||||||||
| 70 | |||||||||||||||||||||
| 71 | =cut | ||||||||||||||||||||
| 72 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=11 SCAR=26.7
Pod
documented
| |||||||||||||||||||||
| 73 | 1 | my $class = shift; | |||||||||||||||||||
| 74 | 1 | my $self = {}; | |||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | 1 | ▶ | if (@_) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 77 | 1 | my ($date, $medium, $locations) = @_; | |||||||||||||||||||
| 78 | |||||||||||||||||||||
| 79 | 1 | ▶ | croak "missing hold-placed-results estimated-date-available" unless ($date); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 80 | 1 | ▶ | croak "invalid hold-placed-results estimated-date-available" unless (ref($date) eq "Biblio::ILL::ISO::ISODate"); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 81 | |||||||||||||||||||||
| 82 | 1 | ▶ | if ($medium) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 83 | 1 | ▶ | croak "invalid hold-placed-medium-type" unless (ref($medium) eq "Biblio::ILL::ISO::MediumType"); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 84 | } | ||||||||||||||||||||
| 85 | 1 | ▶ | if ($locations) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 86 | 1 | ▶ | croak "invalid locations" unless (ref($locations) eq "Biblio::ILL::ISO::LocationInfoSequence"); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 87 | } | ||||||||||||||||||||
| 88 | |||||||||||||||||||||
| 89 | 1 | $self->{"estimated-date-available"} = $date; | |||||||||||||||||||
| 90 | 1 | ▶ | $self->{"hold-placed-medium-type"} = $medium if ($medium); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 91 | 1 | ▶ | $self->{"locations"} = $locations if ($locations);; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 92 | } | ||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | 1 | ▶ | bless($self, ref($class) || $class); | ||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 95 | 1 | return ($self); | |||||||||||||||||||
| 96 | } | ||||||||||||||||||||
| 97 | |||||||||||||||||||||
| 98 | |||||||||||||||||||||
| 99 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 100 | # | ||||||||||||||||||||
| 101 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 102 | =head1 | ||||||||||||||||||||
| 103 | |||||||||||||||||||||
| 104 | =head2 set( $estimated_date_available [,$medium] [,$locations] ) | ||||||||||||||||||||
| 105 | |||||||||||||||||||||
| 106 | Sets the object's estimated-date-available (Biblio::ILL::ISO::ISODate), | ||||||||||||||||||||
| 107 | (optionally) hold-placed-medium-type (Biblio::ILL::ISO::MediumType), and | ||||||||||||||||||||
| 108 | (optionally) locations (Biblio::ILL::ISO::LocationInfoSequence). | ||||||||||||||||||||
| 109 | |||||||||||||||||||||
| 110 | =cut | ||||||||||||||||||||
| 111 | 0 | ▶ | sub set { | ||||||||||||||||||
|
Subroutine
set: not called CC=9 SCAR=45.0
Pod
documented
| |||||||||||||||||||||
| 112 | 0 | my $self = shift; | |||||||||||||||||||
| 113 | |||||||||||||||||||||
| 114 | 0 | my ($date, $medium, $locations) = @_; | |||||||||||||||||||
| 115 | |||||||||||||||||||||
| 116 | 0 | ▶ | croak "missing hold-placed-results estimated-date-available" unless ($date); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 117 | 0 | ▶ | croak "invalid hold-placed-results estimated-date-available" unless (ref($date) eq "Biblio::ILL::ISO::ISODate"); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 118 | |||||||||||||||||||||
| 119 | 0 | ▶ | if ($medium) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 120 | 0 | ▶ | croak "invalid hold-placed-medium-type" unless (ref($medium) eq "Biblio::ILL::ISO::MediumType"); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 121 | } | ||||||||||||||||||||
| 122 | 0 | ▶ | if ($locations) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 123 | 0 | ▶ | croak "invalid locations" unless (ref($locations) eq "Biblio::ILL::ISO::LocationInfoSequence"); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 124 | } | ||||||||||||||||||||
| 125 | |||||||||||||||||||||
| 126 | 0 | $self->{"estimated-date-available"} = $date; | |||||||||||||||||||
| 127 | 0 | ▶ | $self->{"hold-placed-medium-type"} = $medium if ($medium); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 128 | 0 | ▶ | $self->{"locations"} = $locations if ($locations);; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 129 | |||||||||||||||||||||
| 130 | 0 | return; | |||||||||||||||||||
| 131 | } | ||||||||||||||||||||
| 132 | |||||||||||||||||||||
| 133 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 134 | # | ||||||||||||||||||||
| 135 | #--------------------------------------------------------------- | ||||||||||||||||||||
| 136 | =head1 | ||||||||||||||||||||
| 137 | |||||||||||||||||||||
| 138 | =head2 from_asn($href) | ||||||||||||||||||||
| 139 | |||||||||||||||||||||
| 140 | Given a properly formatted hash, builds the object. | ||||||||||||||||||||
| 141 | |||||||||||||||||||||
| 142 | =cut | ||||||||||||||||||||
| 143 | 0 | ▶ | sub from_asn { | ||||||||||||||||||
|
Subroutine
from_asn: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||
| 144 | 0 | my $self = shift; | |||||||||||||||||||
| 145 | 0 | my $href = shift; | |||||||||||||||||||
| 146 | |||||||||||||||||||||
| 147 | 0 | foreach my $k (keys %$href) { | |||||||||||||||||||
| 148 | #print ref($self) . "...$k\n"; | ||||||||||||||||||||
| 149 | |||||||||||||||||||||
| 150 | 0 | ▶ | if ($k =~ /^estimated-date-available$/) { | ||||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||||
| 151 | 0 | $self->{$k} = new Biblio::ILL::ISO::ISODate(); | |||||||||||||||||||
| 152 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||
| 153 | |||||||||||||||||||||
| 154 | } elsif ($k =~ /^hold-placed-medium-type$/) { | ||||||||||||||||||||
| 155 | 0 | $self->{$k} = new Biblio::ILL::ISO::MediumType(); | |||||||||||||||||||
| 156 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||
| 157 | |||||||||||||||||||||
| 158 | } elsif ($k =~ /^locations$/) { | ||||||||||||||||||||
| 159 | 0 | $self->{$k} = new Biblio::ILL::ISO::LocationInfoSequence(); | |||||||||||||||||||
| 160 | 0 | $self->{$k}->from_asn($href->{$k}); | |||||||||||||||||||
| 161 | |||||||||||||||||||||
| 162 | } else { | ||||||||||||||||||||
| 163 | 0 | croak "invalid " . ref($self) . " element: [$k]"; | |||||||||||||||||||
| 164 | } | ||||||||||||||||||||
| 165 | |||||||||||||||||||||
| 166 | } | ||||||||||||||||||||
| 167 | 0 | return $self; | |||||||||||||||||||
| 168 | } | ||||||||||||||||||||
| 169 | |||||||||||||||||||||
| 170 | =head1 SEE ALSO | ||||||||||||||||||||
| 171 | |||||||||||||||||||||
| 172 | See the README for system design notes. | ||||||||||||||||||||
| 173 | See the parent class(es) for other available methods. | ||||||||||||||||||||
| 174 | |||||||||||||||||||||
| 175 | For more information on Interlibrary Loan standards (ISO 10160/10161), | ||||||||||||||||||||
| 176 | a good place to start is: | ||||||||||||||||||||
| 177 | |||||||||||||||||||||
| 178 | http://www.nlc-bnc.ca/iso/ill/main.htm | ||||||||||||||||||||
| 179 | |||||||||||||||||||||
| 180 | =cut | ||||||||||||||||||||
| 181 | |||||||||||||||||||||
| 182 | =head1 AUTHOR | ||||||||||||||||||||
| 183 | |||||||||||||||||||||
| 184 | David Christensen, <DChristensenSPAMLESS@westman.wave.ca> | ||||||||||||||||||||
| 185 | |||||||||||||||||||||
| 186 | =cut | ||||||||||||||||||||
| 187 | |||||||||||||||||||||
| 188 | |||||||||||||||||||||
| 189 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||
| 190 | |||||||||||||||||||||
| 191 | Copyright 2003 by David Christensen | ||||||||||||||||||||
| 192 | |||||||||||||||||||||
| 193 | This library is free software; you can redistribute it and/or modify it | ||||||||||||||||||||
| 194 | under the same terms as Perl itself. | ||||||||||||||||||||
| 195 | |||||||||||||||||||||
| 196 | =cut | ||||||||||||||||||||
| 197 | |||||||||||||||||||||
| 198 | 4 | 1; | |||||||||||||||||||