File Coverage

lib/Plack/Middleware/OAuth/UserInfo.pm
Criterion Covered Total %
statement 9 21 42.8
branch 0 2 0.0
condition n/a
subroutine 3 7 42.8
pod 2 4 50.0
total 14 34 41.1


line stmt bran cond sub pod time code
1             package Plack::Middleware::OAuth::UserInfo;
2 2     2   23 use warnings;
  2         4  
  2         71  
3 2     2   10 use strict;
  2         5  
  2         73  
4 2     2   11 use Plack::Util::Accessor qw(token config);
  2         5  
  2         22  
5              
6             sub new {
7 0     0 0   my $class = shift;
8 0           my %args = @_;
9 0           bless \%args, $class;
10             }
11              
12             # config: provider config hashref
13             # token: access token object
14              
15             sub create_inf {
16 0     0 1   my ($self,$class) = @_;
17 0           return $class->new( token => $self->token , config => $self->config );
18             }
19              
20             sub ask {
21 0     0 1   my ($self,$provider_name) = @_;
22 0 0         if( $provider_name =~ m/^\+/ ) {
23 0           my $info_class = Plack::Util::load_class( $provider_name );
24 0           return $self->create_inf( $info_class )->query;
25             } else {
26 0           my $info_class = Plack::Util::load_class( $provider_name , __PACKAGE__ );
27 0           return $self->create_inf( $info_class )->query;
28             }
29             }
30              
31 0     0 0   sub query { ... }
32              
33             1;
34             __END__