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 SCAR 16.1
CC
5
Cov
95%
__ANON__
5.0
BEGIN
1.0
BEGIN
1.0
CRAP 5.0
« Net/Amazon/S3/Operation/Objects/List/Response.pm ↑ Summary Net/Amazon/S3/Client.pm »
1 package Net::Amazon::S3::Role::ACL;
2 # ABSTRACT: ACL specification
3 99 $Net::Amazon::S3::Role::ACL::VERSION = '0.99';
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 around BUILDARGS => sub {
24 208 ▶ my ($orig, $class) = (shift, shift);
Subroutine __ANON__: called CC=5 SCAR=16.2
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__
45  
46 =pod
47  
48 =encoding UTF-8
49  
50 =head1 NAME
51  
52 Net::Amazon::S3::Role::ACL - ACL specification
53  
54 =head1 VERSION
55  
56 version 0.99
57  
58 =head1 AUTHOR
59  
60 Branislav Zahradník <barney@cpan.org>
61  
62 =head1 COPYRIGHT AND LICENSE
63  
64 This software is copyright (c) 2021 by Amazon Digital Services, Leon Brocard, Brad Fitzpatrick, Pedro Figueiredo, Rusty Conover, Branislav Zahradník.
65  
66 This is free software; you can redistribute it and/or modify it under
67 the same terms as the Perl 5 programming language system itself.
68  
69 =cut
« Net/Amazon/S3/Operation/Objects/List/Response.pm ↑ Summary Net/Amazon/S3/Client.pm »