File Coverage

blib/lib/WebService/CIA/Source.pm
Criterion Covered Total %
statement 22 22 100.0
branch 4 4 100.0
condition 4 6 66.6
subroutine 5 5 100.0
pod 3 3 100.0
total 38 40 95.0


line stmt bran cond sub pod time code
1             package WebService::CIA::Source;
2              
3             require 5.005_62;
4 5     5   28000 use strict;
  5         10  
  5         225  
5 5     5   31 use warnings;
  5         10  
  5         11067  
6              
7             our $VERSION = '1.4';
8              
9              
10             # Preloaded methods go here.
11              
12             sub new {
13              
14 2     2 1 14 my $proto = shift;
15 2         8 my $source = shift;
16 2   33     22 my $class = ref($proto) || $proto;
17 2         7 my $self = {};
18              
19 2         7 bless ($self, $class);
20 2         9 return $self;
21              
22             }
23              
24             sub value {
25              
26 8     8 1 1920 my $self = shift;
27 8         13 my ($cc, $f) = @_;
28 8 100 100     646 if ($cc eq 'testcountry' and $f eq 'Test') {
29 4         19 return 'Wombat';
30             } else {
31 4         19 return;
32             }
33              
34             }
35              
36             sub all {
37              
38 7     7 1 15 my $self = shift;
39 7         26 my $cc = shift;
40 7 100       20 if ($cc eq 'testcountry') {
41 5         26 return {'Test' => 'Wombat'};
42             } else {
43 2         11 return {};
44             }
45              
46             }
47              
48              
49             1;
50             __END__