HTTP/RetryAfter.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 36 CC 2 SCAR 11.5
CC
2
Cov
0%
parse
6.0
empty
2.0
BEGIN
2.0
CRAP 3.1
1 # HTTP RetryAfter line; Section 14.37 of RFC 2616
2 #
3  
4 package IDS::DataSource::HTTP::RetryAfter;
5  
6 use strict;
7 use warnings;
8 use Carp qw(carp confess);
9 use base qw(IDS::DataSource::HTTP::Part);
10  
11 $IDS::DataSource::HTTP::RetryAfter::VERSION = "1.0";
12  
13 sub empty {
14 my $self = shift;
15 undef $self->{"data"}, $self->{"tokens"};
16 }
17  
18 sub parse {
19 my $self = shift;
20 my $value = $self->{"data"}; # convenience
21 my @tokens;
22  
23 $self->mesg(1, *parse{PACKAGE} . "::parse: data '$value'");
24  
25 # The value can be either a date or delta-seconds.
26 if ($value =~ /^\d+$/) {
27 $self->{"sub"} = new IDS::DataSource::HTTP::Int($self->{"params"}, $value);
28 } else {
29 $self->{"sub"} = new IDS::DataSource::HTTP::Date($self->{"params"}, $value);
30 }
31  
32 $self->{"tokens"} = $self->{"sub"}->tokens();
33 $self->mesg(2, *parse{PACKAGE} . "::parse: tokens\n ",
34 "\n ", $self->{"tokens"});
35 }
36  
37 # accessor functions not provided by the superclass
38  
39 =head1 AUTHOR INFORMATION
40  
41 Copyright 2005-2007, Kenneth Ingham. All rights reserved.
42  
43 This library is free software; you can redistribute it and/or modify
44 it under the same terms as Perl itself.
45  
46 Address bug reports and comments to: ids_test at i-pi.com. When sending
47 bug reports, please provide the versions of IDS::Test.pm, IDS::Algorithm.pm,
48 IDS::DataSource.pm, the version of Perl, and the name and version of the
49 operating system you are using. Since Kenneth is a PhD student, the
50 speed of the reponse depends on how the research is proceeding.
51  
52 =head1 BUGS
53  
54 Please report them.
55  
56 =head1 SEE ALSO
57  
58 L<IDS::Algorithm>, L<IDS::DataSource>
59  
60 =cut
61  
62 1;