File Coverage

blib/lib/Pod/WSDL/Fault.pm
Criterion Covered Total %
statement 18 18 100.0
branch 2 2 100.0
condition 4 4 100.0
subroutine 4 4 100.0
pod 1 1 100.0
total 29 29 100.0


line stmt bran cond sub pod time code
1             package Pod::WSDL::Fault;
2 8     8   41886 use strict;
  8         13  
  8         321  
3 8     8   100 use warnings;
  8         16  
  8         306  
4              
5 8     8   706 use Pod::WSDL::AUTOLOAD;
  8         13  
  8         2201  
6              
7             our $VERSION = "0.05";
8             our @ISA = qw/Pod::WSDL::AUTOLOAD/;
9              
10             our %FORBIDDEN_METHODS = (
11             type => {get => 1, set => 0},
12             descr => {get => 1, set => 0},
13             wsdlName => {get => 1, set => 0},
14             );
15              
16             sub new {
17 8     8 1 1806 my ($pkg, $str) = @_;
18              
19 8   100     26 $str ||= '' ; # avoid warnings here, will die soon
20 8 100       70 $str =~ s/^\s*_FAULT\s*//i or die "_FAULT statements must have structure '_FAULT ', like '_FAULT My::Fault This is my documentation'";
21 6         65 my ($type, $descr) = split /\s+/, $str, 2;
22              
23 6         10 my $wsdlName = $type;
24 6         29 $wsdlName =~ s/::(.)/uc $1/eg;
  6         21  
25              
26 6   100     22 $descr ||= '';
27            
28 6         44 bless {
29             _type => $type,
30             _descr => $descr,
31             _wsdlName => ucfirst $wsdlName,
32             }, $pkg;
33             }
34              
35             1;
36             __END__