Google/Credentials.pm

filter: Statementstmt 64.2% 9 / 14 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 1 / 3 Podpod 100% 1 / 1 totaltotal 55.0% 11 / 20 CC 2 SCAR 13.2
CC
2
Cov
56%
get_access_token_for_user
6.0
__ANON__
2.0
BEGIN
1.0
CRAP 3.8
« Google/Discovery.pm ↑ Summary Google/AuthStorage/ConfigJSON.pm »
1 package Moo::Google::Credentials;
2 1 $Moo::Google::Credentials::VERSION = '0.03';
3  
4 # ABSTRACT: Credentials for particular Client instance. You can use this module as singleton also if you need to share credentials between two or more modules
5  
6 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 with 'MooX::Singleton';
8  
9 1 has 'access_token' => ( is => 'rw' );
10 1 has 'user' => ( is => 'rw', trigger => \&get_access_token_for_user )
11 ; # full gmail, like pavel.p.serikov@gmail.com
12 has 'auth_storage' =>
13 0 ▶ ( is => 'rw', default => sub { Moo::Google::AuthStorage->new } )
Subroutine __ANON__: not called CC=1 SCAR=6.9
14 1 ; # dont delete to able to configure
15  
16  
17 0 ▶sub get_access_token_for_user {
Subroutine get_access_token_for_user: not called CC=2 SCAR=17.9
Pod documented
18 0 my $self = shift;
19 0 ▶ if ( $self->auth_storage->is_set )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->auth_storage->is_set) { } 0 0 0
20 { # chech that auth_storage initialized fine
21 0 $self->access_token(
22 $self->auth_storage->get_access_token_from_storage( $self->user ) );
23 }
24 else {
25 0 die "Can get access token for specified user because storage isnt set";
26 }
27 }
28  
29 1 1;
30  
31 __END__
« Google/Discovery.pm ↑ Summary Google/AuthStorage/ConfigJSON.pm »