File Coverage

blib/lib/Pod/WSDL/Return.pm
Criterion Covered Total %
statement 17 17 100.0
branch 6 6 100.0
condition 6 7 85.7
subroutine 4 4 100.0
pod 1 1 100.0
total 34 35 97.1


line stmt bran cond sub pod time code
1             package Pod::WSDL::Return;
2 8     8   16229 use strict;
  8         11  
  8         316  
3 8     8   33 use warnings;
  8         11  
  8         187  
4 8     8   329 use Pod::WSDL::AUTOLOAD;
  8         8  
  8         1595  
5              
6             our $VERSION = "0.05";
7             our @ISA = qw/Pod::WSDL::AUTOLOAD/;
8              
9             our %FORBIDDEN_METHODS = (
10             type => {get => 1, set => 0},
11             array => {get => 1, set => 0},
12             descr => {get => 1, set => 0},
13             );
14              
15             sub new {
16 9     9 1 1661 my ($pkg, $str) = @_;
17              
18 9 100       22 defined $str or $str = ''; # avoids warnings, dies soon
19 9         38 $str =~ s/\s*_RETURN\s*//i;
20 9         20 my ($type, $descr) = split /\s+/, $str, 2;
21              
22 9   100     21 $type ||= ''; # avoids warnings, dies soon
23              
24 9         17 $type =~ /([\$\@])(.+)/;
25 9 100 66     62 die "Type '$type' must have structure (\$|\@), e.g. '\$boolean' or '\@string', died" unless $1 and $2;
26            
27 7 100 100     55 bless {
28             _type => $2,
29             _descr => $descr || '',
30             _array => $1 eq '@' ? 1 : 0,
31             }, $pkg;
32             }
33              
34             1;
35             __END__