File Coverage

blib/lib/WebService/Annict.pm
Criterion Covered Total %
statement 17 21 80.9
branch n/a
condition n/a
subroutine 6 7 85.7
pod 0 1 0.0
total 23 29 79.3


line stmt bran cond sub pod time code
1             package WebService::Annict;
2 1     1   465 use 5.008001;
  1         3  
3 1     1   6 use strict;
  1         1  
  1         29  
4 1     1   4 use warnings;
  1         7  
  1         25  
5              
6 1     1   565 use LWP::UserAgent;
  1         31773  
  1         27  
7 1     1   7 use HTTP::Headers;
  1         1  
  1         19  
8 1     1   420 use WebService::Annict::Works;
  1         2  
  1         149  
9              
10             our $VERSION = "0.01";
11              
12             sub new {
13 0     0 0   my ($class, %args) = @_;
14 0           my $access_token = %args{access_token};
15 0           my $ua = LWP::UserAgent->new(
16             agent => "Perl5 WebService::Annict/$VERSION",
17             default_headers => HTTP::Headers->new(
18             "Content-Type" => "application/json",
19             Accept => "application/json",
20             Authorization => "Bearer $access_token",
21             ),
22             );
23              
24 0           bless {
25             works => WebService::Annict::Works->new($ua),
26             }, $class;
27             }
28              
29              
30              
31             1;
32             __END__