lib/Biblio/ILL/ISO/ResultsExplanation.pm

filter: Statementstmt 50.6% 38 / 75 Branchbran 4.5% 2 / 44 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 84.6% 11 / 13 Podpod 100% 3 / 3 totaltotal 39.2% 55 / 140 CC 25 SCAR 38.8
CC
25
Cov
34%
from_asn
90.0
set
72.0
new
39.6
CRAP 48.4
« lib/Biblio/ILL/ISO/ConditionalResults.pm ↑ Summary lib/Biblio/ILL/ISO/Answer.pm »
1 package Biblio::ILL::ISO::ResultsExplanation;
2  
3 =head1 NAME
4  
5 Biblio::ILL::ISO::ResultsExplanation
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::ConditionalResults;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use Biblio::ILL::ISO::RetryResults;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use Biblio::ILL::ISO::UnfilledResults;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 4 ▶use Biblio::ILL::ISO::LocationsResults;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 4 ▶use Biblio::ILL::ISO::WillSupplyResults;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 4 ▶use Biblio::ILL::ISO::HoldPlacedResults;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 4 ▶use Biblio::ILL::ISO::EstimateResults;
Subroutine BEGIN: called CC=1 SCAR=0.0
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  
25 4 our $VERSION = '0.01';
26 #---------------------------------------------------------------------------
27 # Mods
28 # 0.01 - 2003.07.26 - original version
29 #---------------------------------------------------------------------------
30  
31 =head1 DESCRIPTION
32  
33 Biblio::ILL::ISO::RessultsExplanation is a derivation of Biblio::ILL::ISO::ILLASNtype.
34  
35 =head1 USES
36  
37 Biblio::ILL::ISO::ConditionalResults;
38 Biblio::ILL::ISO::RetryResults;
39 Biblio::ILL::ISO::UnfilledResults;
40 Biblio::ILL::ISO::LocationsResults;
41 Biblio::ILL::ISO::WillSupplyResults;
42 Biblio::ILL::ISO::HoldPlacedResults;
43 Biblio::ILL::ISO::EstimateResults;
44  
45 =head1 USED IN
46  
47 Biblio::ILL::ISO::Answer
48  
49 =cut
50  
51 4 ▶BEGIN{@ISA = qw ( Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype
Subroutine BEGIN: called CC=1 SCAR=0.0
52  
53 =head1 FROM THE ASN DEFINITION
54
55 Results-Explanation ::= CHOICE {
56 conditional-results [1] Conditional-Results,
57 -- chosen if transaction-results=CONDITIONAL
58 retry-results [2] Retry-Results,
59 -- chosen if transaction-results=RETRY
60 unfilled-results [3] Unfilled-Results,
61 --chosen if transaction-results=UNFILLED
62 locations-results [4] Locations-Results,
63 -- chosen if transaction-results=LOCATIONS-PROVIDED
64 will-supply-results [5] Will-Supply-Results,
65 -- chosen if transaction-results=WILL-SUPPLY
66 hold-placed-results [6] Hold-Placed-Results,
67 -- chosen if transaction-results=HOLD-PLACED
68 estimate-results [7] Estimate-Results
69 -- chosen if transaction-results=ESTIMATE
70 }
71  
72 =cut
73  
74 =head1 METHODS
75  
76 =cut
77  
78 #---------------------------------------------------------------
79 #
80 #---------------------------------------------------------------
81 =head1
82  
83 =head2 new( [$resex] )
84  
85 Creates a new ResultsExplanation object.
86 Expects either no parameters or one of:
87 conditional-results (Biblio::ILL::ISO::ConditionalResults),
88 retry-results (Biblio::ILL::ISO::RetryResults),
89 unfilled-results (Biblio::ILL::ISO::UnfilledResults),
90 locations-results (Biblio::ILL::ISO::LocationsResults),
91 will-supply-results (Biblio::ILL::ISO::WillSupplyResults),
92 hold-placed-results (Biblio::ILL::ISO::HoldPlacedResults), or
93 estimate-results (Biblio::ILL::ISO::EstimateResults).
94  
95 =cut
96 1 ▶sub new {
Subroutine new: called CC=10 SCAR=36.8
Pod documented
97 1 my $class = shift;
98 1 my $self = {};
99  
100 1 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 1 0 1
101 1 my $resex = shift;
102 1 ▶ if (ref($resex) eq "Biblio::ILL::ISO::ConditionalResults") {
Branch: 7 branches
BranchTrueFalseTotal
if (ref $resex eq 'Biblio::ILL::ISO::ConditionalResults') { } 1 0 1
elsif (ref $resex eq 'Biblio::ILL::ISO::RetryResults') { } 0 0 0
elsif (ref $resex eq 'Biblio::ILL::ISO::UnfilledResults') { } 0 0 0
elsif (ref $resex eq 'Biblio::ILL::ISO::LocationsResults') { } 0 0 0
elsif (ref $resex eq 'Biblio::ILL::ISO::WillSupplyResults') { } 0 0 0
elsif (ref $resex eq 'Biblio::ILL::ISO::HoldPlacedResults') { } 0 0 0
elsif (ref $resex eq 'Biblio::ILL::ISO::EstimateResults') { } 0 0 0
103 1 $self->{"conditional-results"} = $resex;
104 } elsif (ref($resex) eq "Biblio::ILL::ISO::RetryResults") {
105 0 $self->{"retry-results"} = $resex;
106 } elsif (ref($resex) eq "Biblio::ILL::ISO::UnfilledResults") {
107 0 $self->{"unfilled-results"} = $resex;
108 } elsif (ref($resex) eq "Biblio::ILL::ISO::LocationsResults") {
109 0 $self->{"locations-results"} = $resex;
110 } elsif (ref($resex) eq "Biblio::ILL::ISO::WillSupplyResults") {
111 0 $self->{"will-supply-results"} = $resex;
112 } elsif (ref($resex) eq "Biblio::ILL::ISO::HoldPlacedResults") {
113 0 $self->{"hold-placed-results"} = $resex;
114 } elsif (ref($resex) eq "Biblio::ILL::ISO::EstimateResults") {
115 0 $self->{"estimate-results"} = $resex;
116 } else {
117 }
118 }
119 1 ▶ bless($self, ref($class) || $class);
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
010
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
120 1 return ($self);
121 }
122  
123 #---------------------------------------------------------------
124 #
125 #---------------------------------------------------------------
126 =head1
127  
128 =head2 set( [$resex] )
129  
130 Sets the object's conditional-results (Biblio::ILL::ISO::ConditionalResults),
131 retry-results (Biblio::ILL::ISO::RetryResults),
132 unfilled-results (Biblio::ILL::ISO::UnfilledResults),
133 locations-results (Biblio::ILL::ISO::LocationsResults),
134 will-supply-results (Biblio::ILL::ISO::WillSupplyResults),
135 hold-placed-results (Biblio::ILL::ISO::HoldPlacedResults), or
136 estimate-results (Biblio::ILL::ISO::EstimateResults).
137  
138 =cut
139 0 ▶sub set {
Subroutine set: not called CC=8 SCAR=42.8
Pod documented
140 0 my $self = shift;
141  
142 0 my $resex = shift;
143 0 ▶ if (ref($resex) eq "Biblio::ILL::ISO::ConditionalResults") {
Branch: 7 branches
BranchTrueFalseTotal
if (ref $resex eq 'Biblio::ILL::ISO::ConditionalResults') { } 0 0 0
elsif (ref $resex eq 'Biblio::ILL::ISO::RetryResults') { } 0 0 0
elsif (ref $resex eq 'Biblio::ILL::ISO::UnfilledResults') { } 0 0 0
elsif (ref $resex eq 'Biblio::ILL::ISO::LocationsResults') { } 0 0 0
elsif (ref $resex eq 'Biblio::ILL::ISO::WillSupplyResults') { } 0 0 0
elsif (ref $resex eq 'Biblio::ILL::ISO::HoldPlacedResults') { } 0 0 0
elsif (ref $resex eq 'Biblio::ILL::ISO::EstimateResults') { } 0 0 0
144 0 $self->{"conditional-results"} = $resex;
145 } elsif (ref($resex) eq "Biblio::ILL::ISO::RetryResults") {
146 0 $self->{"retry-results"} = $resex;
147 } elsif (ref($resex) eq "Biblio::ILL::ISO::UnfilledResults") {
148 0 $self->{"unfilled-results"} = $resex;
149 } elsif (ref($resex) eq "Biblio::ILL::ISO::LocationsResults") {
150 0 $self->{"locations-results"} = $resex;
151 } elsif (ref($resex) eq "Biblio::ILL::ISO::WillSupplyResults") {
152 0 $self->{"will-supply-results"} = $resex;
153 } elsif (ref($resex) eq "Biblio::ILL::ISO::HoldPlacedResults") {
154 0 $self->{"hold-placed-results"} = $resex;
155 } elsif (ref($resex) eq "Biblio::ILL::ISO::EstimateResults") {
156 0 $self->{"estimate-results"} = $resex;
157 } else {
158 }
159  
160 0 return;
161 }
162  
163  
164 #---------------------------------------------------------------
165 #
166 #---------------------------------------------------------------
167 =head1
168  
169 =head2 from_asn($href)
170  
171 Given a properly formatted hash, builds the object.
172  
173 =cut
174 0 ▶sub from_asn {
Subroutine from_asn: not called CC=9 SCAR=45.0
Pod documented
175 0 my $self = shift;
176 0 my $href = shift;
177  
178 0 foreach my $k (keys %$href) {
179 #print ref($self) . "...$k\n";
180  
181 0 ▶ if ($k =~ /^conditional-results$/) {
Branch: 7 branches
BranchTrueFalseTotal
if ($k =~ /^conditional-results$/) { } 0 0 0
elsif ($k =~ /^retry-results$/) { } 0 0 0
elsif ($k =~ /^unfilled-results$/) { } 0 0 0
elsif ($k =~ /^locations-results$/) { } 0 0 0
elsif ($k =~ /^will-supply-results$/) { } 0 0 0
elsif ($k =~ /^hold-placed-results$/) { } 0 0 0
elsif ($k =~ /^estimate-results$/) { } 0 0 0
182 0 $self->{$k} = new Biblio::ILL::ISO::ConditionalResults();
183 0 $self->{$k}->from_asn($href->{$k});
184 } elsif ($k =~ /^retry-results$/) {
185 0 $self->{$k} = new Biblio::ILL::ISO::RetryResults();
186 0 $self->{$k}->from_asn($href->{$k});
187 } elsif ($k =~ /^unfilled-results$/) {
188 0 $self->{$k} = new Biblio::ILL::ISO::UnfilledResults();
189 0 $self->{$k}->from_asn($href->{$k});
190 } elsif ($k =~ /^locations-results$/) {
191 0 $self->{$k} = new Biblio::ILL::ISO::LocationsResults();
192 0 $self->{$k}->from_asn($href->{$k});
193 } elsif ($k =~ /^will-supply-results$/) {
194 0 $self->{$k} = new Biblio::ILL::ISO::WillSupplyResults();
195 0 $self->{$k}->from_asn($href->{$k});
196 } elsif ($k =~ /^hold-placed-results$/) {
197 0 $self->{$k} = new Biblio::ILL::ISO::HoldPlacedResults();
198 0 $self->{$k}->from_asn($href->{$k});
199 } elsif ($k =~ /^estimate-results$/) {
200 0 $self->{$k} = new Biblio::ILL::ISO::EstimateResults();
201 0 $self->{$k}->from_asn($href->{$k});
202 } else {
203 0 croak "invalid " . ref($self) . " element: [$k]";
204 }
205  
206 }
207 0 return $self;
208 }
209  
210 =head1 SEE ALSO
211  
212 See the README for system design notes.
213 See the parent class(es) for other available methods.
214  
215 For more information on Interlibrary Loan standards (ISO 10160/10161),
216 a good place to start is:
217  
218 http://www.nlc-bnc.ca/iso/ill/main.htm
219  
220 =cut
221  
222 =head1 AUTHOR
223  
224 David Christensen, <DChristensenSPAMLESS@westman.wave.ca>
225  
226 =cut
227  
228  
229 =head1 COPYRIGHT AND LICENSE
230  
231 Copyright 2003 by David Christensen
232  
233 This library is free software; you can redistribute it and/or modify it
234 under the same terms as Perl itself.
235  
236 =cut
237 =head1
238  
239 =head2 from_asn($href)
240  
241 Given a properly formatted hash, builds the object.
242  
243 =cut
244  
245 4 1;
« lib/Biblio/ILL/ISO/ConditionalResults.pm ↑ Summary lib/Biblio/ILL/ISO/Answer.pm »