| 1 | package PX::API::Request; | ||||||||||||
| 2 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | 2 | ▶ | use version; our $VERSION = qv('0.0.3'); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 2 | ▶ | use HTTP::Request; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | 2 | our @ISA = qw(HTTP::Request); | |||||||||||
| 10 | |||||||||||||
| 11 | 0 | ▶ | sub new { | ||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 12 | 0 | my $class = shift; | |||||||||||
| 13 | 0 | my $args = shift; | |||||||||||
| 14 | |||||||||||||
| 15 | 0 | my $self = HTTP::Request->new(); | |||||||||||
| 16 | 0 | $self->{'method'} = $args->{'method'}; | |||||||||||
| 17 | 0 | $self->{'args'} = $args->{'args'}; | |||||||||||
| 18 | 0 | ▶ | $self->{'format'} = $args->{'format'} || "rest"; | ||||||||||
|
Condition0%0/2
$args->{'format'} || 'rest'
MC/DC0%0/1
$args->{'format'} || 'rest'
$args->{'format'}
Truth table0%0/2
A
A= $args->{'format'}
| |||||||||||||
| 19 | 0 | bless $self, $class; | |||||||||||
| 20 | |||||||||||||
| 21 | 0 | $self->method('GET'); | |||||||||||
| 22 | 0 | $self->uri('http://services.peekshows.com/rest/' . $self->_method_to_uri); | |||||||||||
| 23 | 0 | return $self; | |||||||||||
| 24 | } | ||||||||||||
| 25 | |||||||||||||
| 26 | 0 | ▶ | sub _method_to_uri { | ||||||||||
|
Subroutine
_method_to_uri: not called CC=1 SCAR=6.9
| |||||||||||||
| 27 | 0 | my $self = shift; | |||||||||||
| 28 | 0 | my $uri = $self->{'method'}; | |||||||||||
| 29 | 0 | $uri =~ s/\./\//g; | |||||||||||
| 30 | 0 | return $uri; | |||||||||||
| 31 | } | ||||||||||||
| 32 | |||||||||||||
| 33 | |||||||||||||
| 34 | 2 | 1; | |||||||||||
| 35 | __END__ | ||||||||||||