Net/Amazon/S3/Role/ACL.pm

filter: Statementstmt 100% 30 / 30 Branchbran 75.0% 6 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 95.5% 43 / 45 CC 5 SCAR 10.4
CC
5
Cov
95%
__ANON__
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.8
« Net/Amazon/S3/Request.pm ↑ Summary Net/Amazon/S3.pm »
1 package Net::Amazon::S3::Role::ACL;
2 # ABSTRACT: ACL specification
3 99 $Net::Amazon::S3::Role::ACL::VERSION = '0.992';
4 99 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 99 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 99 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 99 ▶use Net::Amazon::S3::ACL::Set;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 99 ▶use Net::Amazon::S3::ACL::Canned;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 99 ▶use Net::Amazon::S3::Constraint::ACL::Canned;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 99 has acl => (
14 is => 'ro',
15 isa => union ([
16 'Net::Amazon::S3::ACL::Set',
17 'Net::Amazon::S3::ACL::Canned',
18 ]),
19 required => 0,
20 coerce => 1,
21 );
22  
23 208 ▶around BUILDARGS => sub {
Subroutine __ANON__: called CC=5 SCAR=16.2
24 208 my ($orig, $class) = (shift, shift);
25 208 my $args = $class->$orig (@_);
26  
27 208 ▶ if (exists $args->{acl_short}) {
Branch: 1 branch
BranchTrueFalseTotal
if (exists $args->{"acl_short"}) 15 193 208
28 15 my $acl_short = delete $args->{acl_short};
29  
30 Carp::carp "'acl_short' parameter is ignored when 'acl' specified"
31 15 ▶ if exists $args->{acl};
Branch: 1 branch
BranchTrueFalseTotal
if exists $args->{"acl"} 0 15 15
32  
33 $args->{acl} = $acl_short
34 15 ▶ unless exists $args->{acl};
Branch: 1 branch
BranchTrueFalseTotal
unless exists $args->{"acl"} 15 0 15
35 }
36  
37 208 ▶ delete $args->{acl} unless defined $args->{acl};
Branch: 1 branch
BranchTrueFalseTotal
unless defined $args->{"acl"} 127 81 208
38  
39 208 return $args;
40 99 };
41  
42 99 1;
43  
44 __END__
« Net/Amazon/S3/Request.pm ↑ Summary Net/Amazon/S3.pm »