File Coverage

blib/lib/JMAP/Tester/Role/HTTPResult.pm
Criterion Covered Total %
statement 8 10 80.0
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 1 1 100.0
total 12 17 70.5


line stmt bran cond sub pod time code
1 1     1   543 use v5.14.0;
  1         4  
2 1     1   6 use warnings;
  1         2  
  1         39  
3             package JMAP::Tester::Role::HTTPResult 0.103;
4             # ABSTRACT: the kind of thing that you get back for an http request
5              
6 1     1   6 use Moo::Role;
  1         2  
  1         5  
7              
8             with 'JMAP::Tester::Role::Result';
9              
10             #pod =head1 OVERVIEW
11             #pod
12             #pod This is the role consumed by the class of any object returned by
13             #pod L's C method. In addition to
14             #pod L, this role provides C to
15             #pod get at the underlying L object. C will
16             #pod come from the C method of that object.
17             #pod
18             #pod =cut
19              
20             has http_response => (
21             is => 'ro',
22             );
23              
24             #pod =method response_payload
25             #pod
26             #pod Returns the raw payload of the response, if there is one. Empty string
27             #pod otherwise. Mostly this will be C<< $self->http_response->as_string >>
28             #pod but other result types may exist that don't have an http_response...
29             #pod
30             #pod =cut
31              
32             sub response_payload {
33 0     0 1   my ($self) = @_;
34              
35 0 0         return $self->http_response ? $self->http_response->as_string : '';
36             }
37              
38             1;
39              
40             __END__