| 1 | package Sleep::Response; | ||||||||||||
| 2 | |||||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 3 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 3 | ▶ | use JSON::XS; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 1 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||
| 10 | 1 | my $klass = shift; | |||||||||||
| 11 | 1 | ▶ | my $args = shift || {}; | ||||||||||
|
Condition50%1/2
shift() || {}
MC/DC0%0/1
shift() || {}
shift()
Truth table50%1/2
A
A= shift()
| |||||||||||||
| 12 | |||||||||||||
| 13 | 1 | my $self = bless { %$args }, $klass; | |||||||||||
| 14 | |||||||||||||
| 15 | 1 | return $self; | |||||||||||
| 16 | } | ||||||||||||
| 17 | |||||||||||||
| 18 | 2 | ▶ | sub data { | ||||||||||
|
Subroutine
data: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 19 | 2 | my $self = shift; | |||||||||||
| 20 | 2 | return $self->{data}; | |||||||||||
| 21 | } | ||||||||||||
| 22 | |||||||||||||
| 23 | 0 | ▶ | sub location { | ||||||||||
|
Subroutine
location: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 24 | 0 | my $self = shift; | |||||||||||
| 25 | 0 | return $self->{location}; | |||||||||||
| 26 | } | ||||||||||||
| 27 | |||||||||||||
| 28 | 2 | ▶ | sub encode { | ||||||||||
|
Subroutine
encode: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||
| 29 | 2 | my $self = shift; | |||||||||||
| 30 | 2 | my $as = shift; | |||||||||||
| 31 | |||||||||||||
| 32 | 2 | ▶ | if ($as eq 'application/json') { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 33 | 1 | return encode_json($self->data()); | |||||||||||
| 34 | } | ||||||||||||
| 35 | |||||||||||||
| 36 | 1 | croak "Can't encode"; | |||||||||||
| 37 | } | ||||||||||||
| 38 | |||||||||||||
| 39 | 3 | 1; | |||||||||||
| 40 | |||||||||||||
| 41 | __END__ | ||||||||||||