| 1 | package Pod::WSDL::Attr; | ||||||||||||||
| 2 | 9 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 3 | 9 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 9 | ▶ | use Pod::WSDL::AUTOLOAD; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | |||||||||||||||
| 6 | 9 | our $VERSION = "0.05"; | |||||||||||||
| 7 | 9 | our @ISA = qw/Pod::WSDL::AUTOLOAD/; | |||||||||||||
| 8 | |||||||||||||||
| 9 | 9 | our %FORBIDDEN_METHODS = ( | |||||||||||||
| 10 | name => {get => 1, set => 0}, | ||||||||||||||
| 11 | type => {get => 1, set => 0}, | ||||||||||||||
| 12 | nillable => {get => 1, set => 0}, | ||||||||||||||
| 13 | descr => {get => 1, set => 0}, | ||||||||||||||
| 14 | array => {get => 1, set => 0}, | ||||||||||||||
| 15 | ); | ||||||||||||||
| 16 | |||||||||||||||
| 17 | 14 | ▶ | sub new { | ||||||||||||
|
Subroutine
new: called CC=8 SCAR=20.8
Pod
documented
| |||||||||||||||
| 18 | 14 | my ($pkg, $str) = @_; | |||||||||||||
| 19 | |||||||||||||||
| 20 | 14 | ▶ | defined $str or $str = ''; # avoids warnings | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 21 | 14 | ▶ | $str =~ s/\s*_ATTR\s*//i or die "Input string '$str' does not begin with '_ATTR'"; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 22 | 12 | my ($name, $type, $needed, $descr) = split /\s+/, $str, 4; | |||||||||||||
| 23 | |||||||||||||||
| 24 | 12 | ▶ | $descr ||= ''; | ||||||||||||
|
Condition100%2/2
$descr ||= ""
MC/DC100%1/1
$descr ||= ""
$descr
Truth table100%2/2
A
A= $descr
| |||||||||||||||
| 25 | |||||||||||||||
| 26 | 12 | ▶ | if ((uc $needed) ne '_NEEDED') { | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 27 | 4 | $descr = "$needed $descr"; | |||||||||||||
| 28 | 4 | $needed = 0; | |||||||||||||
| 29 | } else { | ||||||||||||||
| 30 | 8 | $needed = 1; | |||||||||||||
| 31 | } | ||||||||||||||
| 32 | |||||||||||||||
| 33 | 12 | $type =~ /([\$\@])(.*)/; | |||||||||||||
| 34 | 12 | ▶ | die "Type '$type' must be prefixed with either '\$' or '\@', died" unless $1; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 35 | |||||||||||||||
| 36 | 11 | ▶ | bless { | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 37 | _name => $name, | ||||||||||||||
| 38 | _type => $2, | ||||||||||||||
| 39 | _nillable => $needed ? undef : 'true', | ||||||||||||||
| 40 | _descr => $descr, | ||||||||||||||
| 41 | _array => $1 eq '@' ? 1 : 0, | ||||||||||||||
| 42 | }, $pkg; | ||||||||||||||
| 43 | } | ||||||||||||||
| 44 | |||||||||||||||
| 45 | 9 | 1; | |||||||||||||
| 46 | __END__ | ||||||||||||||