File Coverage

blib/lib/Biblio/ILL/ISO/ProtocolVersionNum.pm
Criterion Covered Total %
statement 19 20 95.0
branch 2 4 50.0
condition 1 3 33.3
subroutine 5 5 100.0
pod 1 1 100.0
total 28 33 84.8


line stmt bran cond sub pod time code
1             package Biblio::ILL::ISO::ProtocolVersionNum;
2              
3             =head1 NAME
4              
5             Biblio::ILL::ISO::ProtocolVersionNum
6              
7             =cut
8              
9 4     4   611 use Biblio::ILL::ISO::ILLASNtype;
  4         7  
  4         106  
10 4     4   19 use Biblio::ILL::ISO::ENUMERATED;
  4         9  
  4         75  
11              
12 4     4   19 use Carp;
  4         6  
  4         369  
13              
14             =head1 VERSION
15              
16             Version 0.01
17              
18             =cut
19              
20             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::ProtocolVersionNum is a derivation of Biblio::ILL::ISO::ENUMERATED.
29              
30             =head1 USES
31              
32             None.
33              
34             =head1 USED IN
35              
36             Biblio::ILL::ISO::Answer
37             Biblio::ILL::ISO::Cancel
38             Biblio::ILL::ISO::CancelReply
39             Biblio::ILL::ISO::CheckedIn
40             Biblio::ILL::ISO::ConditionalReply
41             Biblio::ILL::ISO::Damaged
42             Biblio::ILL::ISO::Expired
43             Biblio::ILL::ISO::ForwardNotification
44             Biblio::ILL::ISO::Lost
45             Biblio::ILL::ISO::Message
46             Biblio::ILL::ISO::Overdue
47             Biblio::ILL::ISO::Recall
48             Biblio::ILL::ISO::Received
49             Biblio::ILL::ISO::RenewAnswer
50             Biblio::ILL::ISO::Renew
51             Biblio::ILL::ISO::Request
52             Biblio::ILL::ISO::Returned
53             Biblio::ILL::ISO::Shipped
54             Biblio::ILL::ISO::StatusOrErrorReport
55             Biblio::ILL::ISO::StatusQuery
56              
57             =cut
58              
59 4     4   687 BEGIN{@ISA = qw ( Biblio::ILL::ISO::ENUMERATED
60             Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype
61              
62             =head1 FROM THE ASN DEFINITION
63            
64             protocol-version-num [0] IMPLICIT INTEGER, -- {
65             -- version-1 (1),
66             -- version-2 (2)
67             --},
68              
69             =cut
70              
71             =head1 METHODS
72              
73             =cut
74              
75             #---------------------------------------------------------------
76             #
77             #---------------------------------------------------------------
78             =head1
79              
80             =head2 new( $condition )
81              
82             Creates a new ProtocolVersionNum object.
83             Valid paramaters are listed in the FROM THE ASN DEFINITION section
84             (e.g. "version-1").
85              
86             =cut
87             sub new {
88 20     20 1 29 my $class = shift;
89 20         26 my $self = {};
90              
91 20         71 $self->{"ENUM_LIST"} = {"version-1" => 1,
92             "version-2" => 2
93             };
94            
95 20 50       47 if (@_) {
96 20         32 my $s = shift;
97            
98 20 50       45 if ( exists $self->{"ENUM_LIST"}->{$s} ) {
99 20         55 $self->{"ENUMERATED"} = $self->{"ENUM_LIST"}->{$s};
100             } else {
101 0         0 croak "invalid ProtocolVersionNum: [$s]";
102             }
103             }
104              
105 20   33     84 bless($self, ref($class) || $class);
106 20         2829 return ($self);
107             }
108              
109             =head1 SEE ALSO
110              
111             See the README for system design notes.
112             See the parent class(es) for other available methods.
113              
114             For more information on Interlibrary Loan standards (ISO 10160/10161),
115             a good place to start is:
116              
117             http://www.nlc-bnc.ca/iso/ill/main.htm
118              
119             =cut
120              
121             =head1 AUTHOR
122              
123             David Christensen,
124              
125             =cut
126              
127              
128             =head1 COPYRIGHT AND LICENSE
129              
130             Copyright 2003 by David Christensen
131              
132             This library is free software; you can redistribute it and/or modify it
133             under the same terms as Perl itself.
134              
135             =cut
136              
137             1;
138