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   43562 use strict;
  8         18  
  8         273  
3 8     8   42 use warnings;
  8         14  
  8         203  
4 8     8   727 use Pod::WSDL::AUTOLOAD;
  8         14  
  8         2853  
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 2633 my ($pkg, $str) = @_;
17              
18 9 100       30 defined $str or $str = ''; # avoids warnings, dies soon
19 9         44 $str =~ s/\s*_RETURN\s*//i;
20 9         27 my ($type, $descr) = split /\s+/, $str, 2;
21              
22 9   100     28 $type ||= ''; # avoids warnings, dies soon
23              
24 9         24 $type =~ /([\$\@])(.+)/;
25 9 100 66     81 die "Type '$type' must have structure (\$|\@), e.g. '\$boolean' or '\@string', died" unless $1 and $2;
26            
27 7 100 100     93 bless {
28             _type => $2,
29             _descr => $descr || '',
30             _array => $1 eq '@' ? 1 : 0,
31             }, $pkg;
32             }
33              
34             1;
35             __END__