lib/Biblio/ILL/ISO/GeneralProblem.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/Flag.pm ↑ Summary lib/Biblio/ILL/ISO/ILLAPDUtype.pm »
1 package Biblio::ILL::ISO::GeneralProblem;
2  
3 =head1 NAME
4  
5 Biblio::ILL::ISO::GeneralProblem
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 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 =head1 VERSION
14  
15 Version 0.01
16  
17 =cut
18  
19 4 our $VERSION = '0.01';
20 #---------------------------------------------------------------------------
21 # Mods
22 # 0.01 - 2003.08.12 - original version
23 #---------------------------------------------------------------------------
24  
25 =head1 DESCRIPTION
26  
27 Biblio::ILL::ISO::GeneralProblem is a derivation of Biblio::ILL::ISO::ENUMERATED.
28  
29 =head1 USES
30  
31 None.
32  
33 =head1 USED IN
34  
35 Biblio::ILL::ISO::ProviderErrorReport
36  
37 =cut
38  
39 4 ▶BEGIN{@ISA = qw ( Biblio::ILL::ISO::ENUMERATED
Subroutine BEGIN: called CC=1 SCAR=0.0
40 Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype
41  
42 =head1 FROM THE ASN DEFINITION
43
44 General-Problem ::= ENUMERATED {
45 unrecognized-APDU (1),
46 mistyped-APDU (2),
47 badly-structured-APDU (3),
48 protocol-version-not-supported (4),
49 other (5)
50 }
51  
52 =cut
53  
54 =head1 METHODS
55  
56 =cut
57  
58 #---------------------------------------------------------------
59 #
60 #---------------------------------------------------------------
61 =head1
62  
63 =head2 new( $problem )
64  
65 Creates a new GeneralProblem object.
66 Valid paramaters are listed in the FROM THE ASN DEFINITION section
67 (e.g. "unrecognized-APDU").
68  
69 =cut
70 1 ▶sub new {
Subroutine new: called CC=4 SCAR=14.8
Pod documented
71 1 my $class = shift;
72 1 my $self = {};
73  
74 1 $self->{"ENUM_LIST"} = {"unrecognized-APDU" => 1,
75 "mistyped-APDU" => 2,
76 "badly-structured-APDU" => 3,
77 "protocol-version-not-supported" => 4,
78 "other" => 5
79 };
80  
81 1 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 1 0 1
82 1 my $s = shift;
83
84 1 ▶ if ( exists $self->{"ENUM_LIST"}->{$s} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $self->{'ENUM_LIST'}{$s}) { } 1 0 1
85 1 $self->{"ENUMERATED"} = $self->{"ENUM_LIST"}->{$s};
86 } else {
87 0 croak "invalid GeneralProblem type: [$s]";
88 }
89 }
90  
91 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
92 1 return ($self);
93 }
94  
95 =head1 SEE ALSO
96  
97 See the README for system design notes.
98 See the parent class(es) for other available methods.
99  
100 For more information on Interlibrary Loan standards (ISO 10160/10161),
101 a good place to start is:
102  
103 http://www.nlc-bnc.ca/iso/ill/main.htm
104  
105 =cut
106  
107 =head1 AUTHOR
108  
109 David Christensen, <DChristensenSPAMLESS@westman.wave.ca>
110  
111 =cut
112  
113  
114 =head1 COPYRIGHT AND LICENSE
115  
116 Copyright 2003 by David Christensen
117  
118 This library is free software; you can redistribute it and/or modify it
119 under the same terms as Perl itself.
120  
121 =cut
122  
123 4 1;
« lib/Biblio/ILL/ISO/Flag.pm ↑ Summary lib/Biblio/ILL/ISO/ILLAPDUtype.pm »