File Coverage

blib/lib/JMAP/Tester/Role/HTTPResult.pm
Criterion Covered Total %
statement 15 15 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 23 23 100.0


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