File Coverage

blib/lib/WebService/Async/Onfido/Applicant.pm
Criterion Covered Total %
statement 11 31 35.4
branch n/a
condition n/a
subroutine 4 15 26.6
pod 0 8 0.0
total 15 54 27.7


line stmt bran cond sub pod time code
1             package WebService::Async::Onfido::Applicant;
2              
3 2     2   16 use strict;
  2         4  
  2         66  
4 2     2   10 use warnings;
  2         10  
  2         58  
5              
6 2     2   12 use parent qw(WebService::Async::Onfido::Base::Applicant);
  2         4  
  2         31  
7              
8             our $VERSION = '0.006'; # VERSION
9              
10             =head1 NAME
11              
12             WebService::Async::Onfido::Applicant - represents data for Onfido
13              
14             =head1 DESCRIPTION
15              
16             =cut
17              
18             sub as_string {
19 2     2 0 2663 my ($self) = @_;
20 2         103 return sprintf '%s %s (ID %s)', $self->first_name, $self->last_name, $self->id;
21             }
22              
23 0     0 0   sub onfido { return shift->{onfido} }
24              
25             sub documents {
26 0     0 0   my ($self, %args) = @_;
27             return $self->onfido->document_list(
28             applicant_id => $self->id,
29             %args
30 0     0     )->map(sub { $_->{applicant} = $self; $_ });
  0            
  0            
31             }
32              
33             sub photos {
34 0     0 0   my ($self, %args) = @_;
35             return $self->onfido->photo_list(
36             applicant_id => $self->id,
37             %args
38 0     0     )->map(sub { $_->{applicant} = $self; $_ });
  0            
  0            
39             }
40              
41             sub checks {
42 0     0 0   my ($self, %args) = @_;
43             return $self->onfido->check_list(
44             applicant_id => $self->id,
45             %args
46 0     0     )->map(sub { $_->{applicant} = $self; $_ });
  0            
  0            
47             }
48              
49             ## no critic (ProhibitBuiltinHomonyms)
50             sub delete : method {
51 0     0 0   my ($self, %args) = @_;
52 0           return $self->onfido->applicant_delete(
53             applicant_id => $self->id,
54             %args
55             );
56             }
57              
58             sub check {
59 0     0 0   my ($self, %args) = @_;
60             return $self->onfido->applicant_check(
61             applicant_id => $self->id,
62             %args,
63             )->on_done(
64             sub {
65 0     0     shift->{applicant} = $self;
66 0           });
67             }
68              
69             sub get : method {
70 0     0 0   my ($self) = @_;
71 0           return $self->onfido->applicant_get(
72             applicant_id => $self->id,
73             );
74             }
75              
76             1;
77              
78             __END__
79              
80             =head1 AUTHOR
81              
82             deriv.com C<< DERIV@cpan.org >>
83              
84             =head1 LICENSE
85              
86             Copyright deriv.com 2019. Licensed under the same terms as Perl itself.
87