APIClient/Pending.pm untested

filter: Statementstmt 0.0% 0 / 18 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 27 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
get_details
2.0
promise
2.0
CRAP 2.0
1 package cPanel::APIClient::Pending;
2  
3 use strict;
4 use warnings;
5  
6 =encoding utf-8
7  
8 =head1 NAME
9  
10 cPanel::APIClient::Pending
11  
12 =head1 DESCRIPTION
13  
14 This class encapsulates a pending API request.
15  
16 =cut
17  
18 #----------------------------------------------------------------------
19  
20 use Call::Context ();
21  
22 #----------------------------------------------------------------------
23  
24 # Left undocumented since instantiation is internal-only.
25 sub new {
26 my ( $class, $promise, @details ) = @_;
27  
28 return bless [ $promise, @details ], $class;
29 }
30  
31 # This also is not (yet?) meant for public consumption.
32 sub get_details {
33 Call::Context::must_be_list();
34  
35 return @{ $_[0] }[ 1 .. $#{ $_[0] } ];
36 }
37  
38 =head1 METHODS
39  
40 This class is not documented for public instantiation.
41 Functionality that pertains to callers’ interest is documented below:
42  
43 =head2 $promise = I<OBJ>->promise()
44  
45 Returns a promise object (whose specific class is determined by the
46 chosen transport mechanism) that will resolve or reject according to
47 whether the API request succeeds or fails.
48  
49 =cut
50  
51 sub promise {
52 return $_[0][0];
53 }
54  
55 =head1 LICENSE
56  
57 Copyright 2020 cPanel, L. L. C. All rights reserved. L<http://cpanel.net>
58  
59 This is free software; you can redistribute it and/or modify it under the
60 same terms as Perl itself. See L<perlartistic>.
61  
62 =cut
63  
64 1;