File Coverage

blib/lib/API/Shippo.pm
Criterion Covered Total %
statement 51 51 100.0
branch n/a
condition 1 2 50.0
subroutine 15 15 100.0
pod n/a
total 67 68 98.5


line stmt bran cond sub pod time code
1 1     1   998 use strict;
  1         2  
  1         28  
2 1     1   6 use warnings;
  1         1  
  1         58  
3              
4             package API::Shippo;
5             # ABSTRACT: Shippo Perl API wrapper
6             our $VERSION = '0.0.1';
7 1     1   13 use Carp ( 'croak' );
  1         1  
  1         66  
8 1     1   645 use API::Shippo::Config;
  1         4  
  1         54  
9 1     1   926 use API::Shippo::Address;
  1         2  
  1         28  
10 1     1   477 use API::Shippo::CustomsItem;
  1         3  
  1         24  
11 1     1   514 use API::Shippo::CustomsDeclaration;
  1         3  
  1         33  
12 1     1   572 use API::Shippo::Manifest;
  1         3  
  1         34  
13 1     1   516 use API::Shippo::Parcel;
  1         2  
  1         25  
14 1     1   481 use API::Shippo::Refund;
  1         3  
  1         30  
15 1     1   773 use API::Shippo::Shipment;
  1         2  
  1         26  
16 1     1   528 use API::Shippo::Transaction;
  1         3  
  1         24  
17 1     1   495 use API::Shippo::Rate;
  1         3  
  1         25  
18 1     1   491 use API::Shippo::CarrierAccount;
  1         2  
  1         141  
19              
20             sub import
21             {
22 1     1   10 my ( $class ) = @_;
23 1         8 my $c = API::Shippo::Config->config;
24 1         2 my $private_token = $c->{private_token};
25 1         2 my $public_token = $c->{public_token};
26 1   50     7 my $default_token = $c->{default_token} || 'public_token';
27             # Setup some resource defaults
28 1         5 API::Shippo::Resource->api_private_token( $private_token );
29 1         4 API::Shippo::Resource->api_public_token( $public_token );
30 1         8 API::Shippo::Resource->api_token( $c->{$default_token} );
31 1         35 goto &Exporter::import;
32             }
33              
34             =pod
35              
36             =encoding utf8
37              
38             =head1 NAME
39              
40             API::Shippo - A Shippo API Perl Wrapper (coming soon)
41              
42             =head1 VERSION
43              
44             version 0.0.1
45              
46             =head1 SYNOPIS
47              
48             # TO FOLLOW
49            
50             =head1 DESCRIPTION
51              
52             Will provide a Shippo API client implementation for Perl.
53              
54             This is a work in progress and is being actively developed with regular
55             updates as work progresses.
56              
57             =head1 AUTHOR
58              
59             Iain Campbell
60              
61             =head1 COPYRIGHT AND LICENSE
62              
63             This software is copyright (c) 2012-2015 by Iain Campbell.
64              
65             This is free software; you can redistribute it and/or modify it under
66             the same terms as the Perl 5 programming language system itself.
67              
68             =cut
69              
70             1;