File Coverage

lib/Amazon/S3/Signature/V4.pm
Criterion Covered Total %
statement 9 23 39.1
branch 0 4 0.0
condition 0 3 0.0
subroutine 3 5 60.0
pod 1 2 50.0
total 13 37 35.1


line stmt bran cond sub pod time code
1             package Amazon::S3::Signature::V4;
2              
3 2     2   13 use strict;
  2         3  
  2         56  
4 2     2   9 use warnings;
  2         4  
  2         55  
5              
6 2     2   9 use parent qw{Net::Amazon::Signature::V4};
  2         35  
  2         11  
7              
8             ########################################################################
9             sub new {
10             ########################################################################
11 0     0 1   my ( $class, @args ) = @_;
12              
13 0           my %options;
14              
15 0 0         if ( !ref $args[0] ) {
16 0           @options{qw{access_key_id secret endpoint service}} = @args;
17             }
18             else {
19 0           %options = %{ $args[0] };
  0            
20             }
21              
22 0           my $region = delete $options{region};
23 0   0       $options{endpoint} //= $region;
24              
25 0           my $self = $class->SUPER::new( \%options );
26              
27 0           return $self;
28             }
29              
30             ########################################################################
31             sub region {
32             ########################################################################
33 0     0 0   my ( $self, @args ) = @_;
34              
35 0 0         if (@args) {
36 0           $self->{endpoint} = $args[0];
37             }
38              
39 0           return $self->{endpoint};
40             }
41              
42             1;