blib/lib/WWW/LogicBoxes/Domain/Factory.pm

filter: Statementstmt 62.9% 17 / 27 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 1 totaltotal 52.3% 22 / 42 CC 5 SCAR 27.4
CC
5
Cov
49%
construct_from_response
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 15.5
« blib/lib/WWW/LogicBoxes/Role/Command/Domain/PrivateNameServer.pm ↑ Summary blib/lib/WWW/LogicBoxes/DomainTransfer.pm »
1 package WWW::LogicBoxes::Domain::Factory;
2  
3 37 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 37 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 37 ▶use WWW::LogicBoxes::Domain;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 37 ▶use WWW::LogicBoxes::DomainTransfer;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 37 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 37 our $VERSION = '1.1.0'; # VERSION
12 # ABSTRACT: Domain Factory for Building Domain Objects from Responses
13  
14 sub construct_from_response {
15 0 ▶ my $self = shift;
Subroutine construct_from_response: not called CC=5 SCAR=34.0
Pod undocumented
16 0 my $response = shift;
17  
18 0 ▶ if( !$response ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($response) 0 0 0
19 0 return;
20 }
21  
22 0 ▶ if( $response->{actiontype} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($response->{'actiontype'}) { } 0 0 0
23 0 ▶ if( $response->{actiontype} eq 'AddTransferDomain' ) {
Branch: 2 branches
BranchTrueFalseTotal
if ($response->{'actiontype'} eq 'AddTransferDomain') { } 0 0 0
elsif ($response->{'actiontype'} eq 'DelDomain') { } 0 0 0
24 0 return WWW::LogicBoxes::DomainTransfer->construct_from_response( $response );
25 }
26 elsif( $response->{actiontype} eq 'DelDomain' ) {
27 0 return WWW::LogicBoxes::Domain->construct_from_response( $response );
28 }
29 else {
30 0 croak $response->{actiontype} . ' is an unknown action type';
31 }
32 }
33 else {
34 0 return WWW::LogicBoxes::Domain->construct_from_response( $response );
35 }
36 }
37  
38 37 1;
39  
40 __END__
« blib/lib/WWW/LogicBoxes/Role/Command/Domain/PrivateNameServer.pm ↑ Summary blib/lib/WWW/LogicBoxes/DomainTransfer.pm »