| 1 | package LibCAS::Client::Response; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 9 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 9 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 9 | our $VERSION = '0.01'; | |||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | 6 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
undocumented
| |||||||||||||||||||||
| 9 | 6 | my $this = shift; | |||||||||||||||||||
| 10 | 6 | my %args = @_; | |||||||||||||||||||
| 11 | |||||||||||||||||||||
| 12 | 6 | my $self = { ok => undef, response => undef}; | |||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 6 | map { $self->{$_} = $args{$_} } keys %args; | |||||||||||||||||||
| 15 | |||||||||||||||||||||
| 16 | 6 | ▶ | my $class = ref($this) || $this; | ||||||||||||||||||
|
Condition33%1/3
ref $this || $this
MC/DC0%0/2
ref $this || $this
ref $this
$this
Truth table33%1/3
A || B
A= ref $thisB= $this
| |||||||||||||||||||||
| 17 | |||||||||||||||||||||
| 18 | 6 | bless($self, $class); | |||||||||||||||||||
| 19 | 6 | return $self; | |||||||||||||||||||
| 20 | } | ||||||||||||||||||||
| 21 | |||||||||||||||||||||
| 22 | 5 | ▶ | sub is_error { | ||||||||||||||||||
|
Subroutine
is_error: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 23 | 5 | my $self = shift; | |||||||||||||||||||
| 24 | 5 | return ! defined $self->{ok}; | |||||||||||||||||||
| 25 | } | ||||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | 5 | ▶ | sub is_failure { | ||||||||||||||||||
|
Subroutine
is_failure: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 28 | 5 | my $self = shift; | |||||||||||||||||||
| 29 | 5 | ▶ | return (defined $self->{ok} && ! $self->{ok}); | ||||||||||||||||||
|
Condition100%3/3
defined $self->{'ok'} && !$self->{'ok'}
MC/DC100%2/2
defined $self->{'ok'} && !$self->{'ok'}
defined $self->{'ok'}
!$self->{'ok'}
Truth table100%3/3
A && not(B)
A= defined $self->{'ok'}B= !$self->{'ok'}
| |||||||||||||||||||||
| 30 | } | ||||||||||||||||||||
| 31 | |||||||||||||||||||||
| 32 | 5 | ▶ | sub is_success { | ||||||||||||||||||
|
Subroutine
is_success: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 33 | 5 | my $self = shift; | |||||||||||||||||||
| 34 | 5 | ▶ | return (defined $self->{ok} && $self->{ok}); | ||||||||||||||||||
|
Condition100%3/3
defined $self->{'ok'} && $self->{'ok'}
MC/DC100%2/2
defined $self->{'ok'} && $self->{'ok'}
defined $self->{'ok'}
$self->{'ok'}
Truth table100%3/3
A && B
A= defined $self->{'ok'}B= $self->{'ok'}
| |||||||||||||||||||||
| 35 | } | ||||||||||||||||||||
| 36 | |||||||||||||||||||||
| 37 | 0 | ▶ | sub response { | ||||||||||||||||||
|
Subroutine
response: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||
| 38 | 0 | my $self = shift; | |||||||||||||||||||
| 39 | 0 | my $response = shift; | |||||||||||||||||||
| 40 | |||||||||||||||||||||
| 41 | 0 | ▶ | if (defined $response) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 42 | 0 | $self->{response} = $response; | |||||||||||||||||||
| 43 | } | ||||||||||||||||||||
| 44 | |||||||||||||||||||||
| 45 | 0 | return $self->{response}; | |||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | |||||||||||||||||||||
| 48 | 9 | 1; | |||||||||||||||||||