Docusign/login.pm

filter: Statementstmt 44.8% 13 / 29 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 100% 1 / 1 totaltotal 43.9% 18 / 41 CC 5 SCAR 28.4
CC
5
Cov
37%
new
30.0
BEGIN
1.0
BEGIN
1.0
CRAP 17.1
« Docusign.pm ↑ Summary Docusign/buildCredentials.pm »
1 package Document::eSign::Docusign::login;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use Data::Dumper;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 =head1 NAME
8  
9 Document::eSign::Docusign::login - Handles the login to Docusign. Should not be used outside of this module.
10  
11 =head1 VERSION
12  
13 Version 0.02
14  
15 =cut
16  
17 =head1 functions
18  
19 =head2 new($parent, $vars)
20  
21 Takes the parent class and a hashref of options as arguments. Performs the login and sets the parent object's internal vars.
22  
23 =cut
24  
25 0 ▶sub new {
Subroutine new: not called CC=5 SCAR=34.0
Pod documented
26 0 ▶ carp("Got login request: " . Dumper(@_)) if $_[1]->debug;
Branch: 1 branch
BranchTrueFalseTotal
if $_[1]->debug 0 0 0
27 0 my $class = shift;
28 0 my $main = shift;
29 0 my $vars = shift;
30 0 my $self = bless {}, $class;
31
32 0 my $uri = '/v2/login_information?';
33
34 # Build the portions of the get string as needed.
35
36 0 for ( qw{api_password include_account_id_guid login_settings} ) {
37 0 ▶ if (defined $vars->{$_} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $vars->{$_}) 0 0 0
38 0 $uri .= $_ . '=' . $vars->{$_};
39 }
40 }
41
42 0 my $creds = $main->buildCredentials();
43
44 0 my $response = $main->sendRequest('GET', undef, $creds, $main->baseUrl . $uri, undef);
45
46 0 ▶ while ( my ( $key, $value ) = each %{$response->{loginAccounts}->[0]} ) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %{$$response{"loginAccounts"}[0];}) 0 0 0
47 0 eval {$main->$key($value)};
48 }
49
50 0 return $self;
51 }
52  
53  
54 1 1;
« Docusign.pm ↑ Summary Docusign/buildCredentials.pm »