| 1 | package WebService::Client::Response; | ||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use Moo; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 3 | our $VERSION = '1.0100'; # VERSION | |||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 3 | ▶ | use JSON::MaybeXS (); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 7 | 3 | ▶ | use Scalar::Util qw(blessed); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | has res => ( | ||||||||||||||||||||||||||||
| 10 | is => 'ro', | ||||||||||||||||||||||||||||
| 11 | 0 | ▶ | isa => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=3 SCAR=24.8
| |||||||||||||||||||||||||||||
| 12 | 0 | ▶ | die 'res must be a HTTP::Response object' | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
builtin::blessed($_[0]) and $_[0]->isa("HTTP::Response")
MC/DC0%0/2
builtin::blessed($_[0]) and $_[0]->isa("HTTP::Response")
builtin::blessed($_[0])
$_[0]->isa("HTTP::Response")
Truth table0%0/3
A and B
A= builtin::blessed($_[0])B= $_[0]->isa("HTTP::Response")
| |||||||||||||||||||||||||||||
| 13 | unless blessed($_[0]) && $_[0]->isa('HTTP::Response'); | ||||||||||||||||||||||||||||
| 14 | }, | ||||||||||||||||||||||||||||
| 15 | 3 | required => 1, | |||||||||||||||||||||||||||
| 16 | handles => [qw( | ||||||||||||||||||||||||||||
| 17 | code | ||||||||||||||||||||||||||||
| 18 | content | ||||||||||||||||||||||||||||
| 19 | decoded_content | ||||||||||||||||||||||||||||
| 20 | is_error | ||||||||||||||||||||||||||||
| 21 | is_success | ||||||||||||||||||||||||||||
| 22 | status_line | ||||||||||||||||||||||||||||
| 23 | )], | ||||||||||||||||||||||||||||
| 24 | ); | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | has json => ( | ||||||||||||||||||||||||||||
| 27 | is => 'ro', | ||||||||||||||||||||||||||||
| 28 | lazy => 1, | ||||||||||||||||||||||||||||
| 29 | 0 | ▶ | default => sub { JSON::MaybeXS->new() }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 30 | 3 | ); | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 0 | ▶ | sub data { | ||||||||||||||||||||||||||
|
Subroutine
data: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 33 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 34 | 0 | return $self->json->decode($self->decoded_content); | |||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 0 | ▶ | sub ok { | ||||||||||||||||||||||||||
|
Subroutine
ok: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 38 | 0 | my ($self) = @_; | |||||||||||||||||||||||||||
| 39 | 0 | return $self->is_success; | |||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 3 | 1; | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | __END__ | ||||||||||||||||||||||||||||