File Coverage

blib/lib/JMAP/Tester/WebSocket/Response.pm
Criterion Covered Total %
statement 20 24 83.3
branch n/a
condition n/a
subroutine 7 10 70.0
pod 0 3 0.0
total 27 37 72.9


line stmt bran cond sub pod time code
1 1     1   13 use v5.10.0;
  1         4  
2 1     1   7 use warnings;
  1         13  
  1         48  
3              
4             package JMAP::Tester::WebSocket::Response;
5             # ABSTRACT: what you get in reply to a succesful JMAP request
6             $JMAP::Tester::WebSocket::Response::VERSION = '0.001';
7 1     1   21 use Moo;
  1         4  
  1         8  
8             with 'JMAP::Tester::Role::SentenceCollection', 'JMAP::Tester::WebSocket::Role::WebSocketResult';
9              
10 1     1   832 use JMAP::Tester::Response::Sentence;
  1         32632  
  1         38  
11 1     1   491 use JMAP::Tester::Response::Paragraph;
  1         35466  
  1         35  
12 1     1   437 use JMAP::Tester::SentenceBroker;
  1         2784  
  1         31  
13              
14 1     1   6 use namespace::clean;
  1         2  
  1         6  
15              
16             #pod =head1 OVERVIEW
17             #pod
18             #pod A JMAP::Tester::Response object represents the successful response to a JMAP
19             #pod call. It is a successful L.
20             #pod
21             #pod A Response is used mostly to contain the responses to the individual methods
22             #pod passed in the request.
23             #pod
24             #pod =cut
25              
26 0     0 0   sub is_success { 1 }
27              
28             has items => (
29             is => 'bare',
30             reader => '_items',
31             required => 1,
32             );
33              
34             has wrapper_properties => (
35             is => 'ro',
36             );
37              
38 0     0 0   sub items { @{ $_[0]->_items } }
  0            
39              
40             sub add_items {
41             $_[0]->sentence_broker->abort_callback->("can't add items to " . __PACKAGE__);
42             }
43              
44             sub sentence_broker {
45 0     0 0   state $BROKER = JMAP::Tester::SentenceBroker->new;
46             }
47              
48             1;
49              
50             __END__