File Coverage

blib/lib/Paws/Net/APIRequest.pm
Criterion Covered Total %
statement 17 17 100.0
branch 2 2 100.0
condition n/a
subroutine 6 6 100.0
pod 0 2 0.0
total 25 27 92.5


line stmt bran cond sub pod time code
1             package Paws::Net::APIRequest;
2 20     20   147 use Moose;
  20         49  
  20         151  
3 20     20   161864 use HTTP::Headers;
  20         139494  
  20         828  
4 20     20   9957 use URI;
  20         80780  
  20         4262  
5              
6             has parameters => (is => 'rw', isa => 'HashRef', default => sub { {} });
7             has headers => (is => 'rw', isa => 'HTTP::Headers', default => sub { HTTP::Headers->new });
8             has content => (is => 'rw', isa => 'Str|Undef');
9             has method => (is => 'rw', isa => 'Str');
10             has uri => (is => 'rw', isa => 'Str');
11             has url => (is => 'rw', isa => 'Str');
12              
13             sub header {
14 1046     1046 0 62851 my ($self, $header, $value) = @_;
15 1046 100       10013 $self->headers->header($header, $value) if (defined $value);
16 1046         42707 return $self->headers->header($header);
17             }
18              
19             sub header_hash {
20 20     20 0 48 my $self = shift;
21 20         56 my $headers = {};
22 20     120   604 $self->headers->scan(sub { $headers->{ $_[0] } = $_[1] });
  120         1884  
23 20         151 return $headers;
24             }
25             1;