File Coverage

blib/lib/PayProp/API/Public/Client/Authorization/APIKey.pm
Criterion Covered Total %
statement 16 16 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 22 22 100.0


line stmt bran cond sub pod time code
1             package PayProp::API::Public::Client::Authorization::APIKey;
2              
3 26     26   966144 use strict;
  26         53  
  26         947  
4 26     26   119 use warnings;
  26         40  
  26         1536  
5              
6 26     26   2226 use Mouse;
  26         148700  
  26         216  
7             extends qw/ PayProp::API::Public::Client::Authorization::Base /;
8              
9 26     26   29264 use Mojo::Promise;
  26         10090636  
  26         182  
10              
11             has token => (
12             is => 'ro',
13             isa => 'Str',
14             required => 1,
15             );
16              
17             has '+token_type' => ( default => sub { 'APIkey' } );
18              
19             sub _token_request_p {
20 43     43   3585 my ( $self ) = @_;
21              
22             return Mojo::Promise
23             ->new( sub {
24 43     43   5633 my ( $resolve, $reject ) = @_;
25              
26 43         916 return $resolve->({
27             token => $self->token,
28             token_type => $self->token_type,
29             });
30             } )
31 43         1763 ;
32             }
33              
34             __PACKAGE__->meta->make_immutable;
35              
36             __END__