lib/Biblio/ILL/ISO/AmountString.pm

filter: Statementstmt 60.7% 17 / 28 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 55.5% 5 / 9 Podpod 100% 6 / 6 totaltotal 60.0% 30 / 50 CC 3 SCAR 6.7
CC
3
Cov
58%
new
3.2
set
2.0
as_string
2.0
CRAP 2.0
« script/ISOtypetest.pm ↑ Summary lib/Biblio/ILL/ISO/1_0_10161_13_3.pm »
1 package Biblio::ILL::ISO::AmountString;
2  
3 =head1 NAME
4  
5 Biblio::ILL::ISO::AmountString
6  
7 =cut
8  
9 4 ▶use Biblio::ILL::ISO::ILLASNtype;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 =head1 VERSION
13  
14 Version 0.01
15  
16 =cut
17  
18 4 our $VERSION = '0.01';
19 #---------------------------------------------------------------------------
20 # Mods
21 # 0.01 - 2003.07.15 - original version
22 #---------------------------------------------------------------------------
23  
24 =head1 DESCRIPTION
25  
26 Biblio::ILL::ISO::AmountString is a derivation of Biblio::ILL::ISO::ILLASNtype.
27  
28 =head1 USES
29  
30 None.
31  
32 =head1 USED IN
33  
34 Biblio::ILL::ISO::Amount
35  
36 =cut
37  
38 4 ▶BEGIN{@ISA = qw ( Biblio::ILL::ISO::ILLASNtype );} # inherit from ILLASNtype
Subroutine BEGIN: called CC=1 SCAR=0.0
39  
40 =head1 FROM THE ASN DEFINITION
41
42 AmountString ::= PrintableString -- (FROM ("1"|"2"|"3"|"4"|"5"|"6"|"7"|"8"|"9"|"0"|" "|"."|","))
43  
44 =cut
45  
46 =head1 METHODS
47  
48 =cut
49  
50 #---------------------------------------------------------------
51 #
52 #---------------------------------------------------------------
53 =head1
54  
55 =head2 new( [$string] )
56  
57 Creates a new AmountString object. Expects either no parameters, or
58 a text string. Currently does not implement the character restrictions.
59  
60 =cut
61 11 ▶sub new {
Subroutine new: called CC=3 SCAR=11.6
Pod documented
62 11 my $class = shift;
63 11 my $self = {};
64  
65 11 ▶ if (@_) {
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 11 0 11
66 11 $self->{"PrintableString"} = shift;
67 }
68 11 ▶ bless($self, ref($class) || $class);
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
0110
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
69 11 return ($self);
70 }
71  
72 #---------------------------------------------------------------
73 #
74 #---------------------------------------------------------------
75 =head1
76  
77 =head2 set($string)
78  
79 Sets the object's PrintableString. Currently does not implement the
80 ASN.1 AmountString character restrictions.
81  
82 =cut
83 0 ▶sub set {
Subroutine set: not called CC=1 SCAR=6.9
Pod documented
84 0 my $self = shift;
85  
86 0 $self->{"PrintableString"} = shift;
87 0 return;
88 }
89  
90 #---------------------------------------------------------------
91 #
92 #---------------------------------------------------------------
93 =head1
94  
95 =head2 as_string( )
96  
97 Returns a stringified representation of the object.
98  
99 =cut
100 0 ▶sub as_string {
Subroutine as_string: not called CC=1 SCAR=6.9
Pod documented
101 0 my $self = shift;
102  
103 0 return $self->{"PrintableString"};
104 }
105  
106 #---------------------------------------------------------------
107 #
108 #---------------------------------------------------------------
109 =head1
110  
111 =head2 as_pretty_string( )
112  
113 Returns a more-formatted stringified representation of the object.
114  
115 =cut
116 0 ▶sub as_pretty_string {
Subroutine as_pretty_string: not called CC=1 SCAR=6.9
Pod documented
117 0 my $self = shift;
118  
119 0 return $self->{"PrintableString"} . "\n";
120 }
121  
122 #---------------------------------------------------------------
123 # This will return a structure usable by Convert::ASN1
124 #---------------------------------------------------------------
125 =head1
126  
127 =head2 as_asn( )
128  
129 Returns a structure usable by Convert::ASN1. Generally only called
130 from the parent's as_asn() method (or encode() method for top-level
131 message-type objects).
132  
133 =cut
134 5 ▶sub as_asn {
Subroutine as_asn: called CC=1 SCAR=0.0
Pod documented
135 5 my $self = shift;
136  
137 5 return $self->{"PrintableString"};
138 }
139  
140 #---------------------------------------------------------------
141 #
142 #---------------------------------------------------------------
143 =head1
144  
145 =head2 from_asn($href)
146  
147 Given a properly formatted hash, builds the object.
148  
149 =cut
150 0 ▶sub from_asn {
Subroutine from_asn: not called CC=1 SCAR=6.9
Pod documented
151 0 my $self = shift;
152 0 my $val = shift;
153  
154 0 $self->{"PrintableString"} = $val;
155  
156 0 return $self;
157 }
158  
159 =head1 SEE ALSO
160  
161 See the README for system design notes.
162 See the parent class(es) for other available methods.
163  
164 For more information on Interlibrary Loan standards (ISO 10160/10161),
165 a good place to start is:
166  
167 http://www.nlc-bnc.ca/iso/ill/main.htm
168  
169 =cut
170  
171 =head1 AUTHOR
172  
173 David Christensen, <DChristensenSPAMLESS@westman.wave.ca>
174  
175 =cut
176  
177  
178 =head1 COPYRIGHT AND LICENSE
179  
180 Copyright 2003 by David Christensen
181  
182 This library is free software; you can redistribute it and/or modify it
183 under the same terms as Perl itself.
184  
185 =cut
186  
187 4 1;
« script/ISOtypetest.pm ↑ Summary lib/Biblio/ILL/ISO/1_0_10161_13_3.pm »