File Coverage

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


line stmt bran cond sub pod time code
1 10     10   333238 use v5.20.0;
  10         41  
2 10     10   56 use warnings;
  10         18  
  10         723  
3             package JMAP::Tester::Role::HTTPResult 0.109;
4             # ABSTRACT: the kind of thing that you get back for an http request
5              
6 10     10   618 use Moo::Role;
  10         15513  
  10         76  
7              
8             with 'JMAP::Tester::Role::Result';
9              
10 10     10   7272 use experimental 'signatures';
  10         7487  
  10         67  
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 2     2 1 7390 sub response_payload ($self) {
  2         4  
  2         4  
35 2 50       30 return $self->http_response ? $self->http_response->as_string : '';
36             }
37              
38             1;
39              
40             __END__