File Coverage

blib/lib/PX/API/Request.pm
Criterion Covered Total %
statement 15 29 51.7
branch n/a
condition 0 2 0.0
subroutine 5 7 71.4
pod 1 1 100.0
total 21 39 53.8


line stmt bran cond sub pod time code
1             package PX::API::Request;
2 1     1   13888 use warnings;
  1         2  
  1         30  
3 1     1   5 use strict;
  1         1  
  1         26  
4 1     1   4 use Carp;
  1         2  
  1         69  
5              
6 1     1   4 use version; our $VERSION = qv('0.0.3');
  1         1  
  1         7  
7              
8 1     1   1149 use HTTP::Request;
  1         111536  
  1         335  
9             our @ISA = qw(HTTP::Request);
10              
11             sub new {
12 0     0 1   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   0       $self->{'format'} = $args->{'format'} || "rest";
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             sub _method_to_uri {
27 0     0     my $self = shift;
28 0           my $uri = $self->{'method'};
29 0           $uri =~ s/\./\//g;
30 0           return $uri;
31             }
32              
33              
34             1;
35             __END__