« Net/Amazon/S3/Operation/Bucket/Location/Response.pm
↑ Summary
Net/Amazon/S3/Request/Role/XML/Content.pm »
| 1 | package Net::Amazon::S3::Role::Bucket; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | # ABSTRACT: Bucket role | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 99 | $Net::Amazon::S3::Role::Bucket::VERSION = '0.992'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 99 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 99 | ▶ | use Scalar::Util; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 99 | ▶ | use Safe::Isa (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 708 | ▶ | around BUILDARGS => sub { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=9 SCAR=22.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 708 | my ($orig, $class, %params) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | # bucket can be optional in HTTPRequest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 708 | ▶ | if ($params{bucket}) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 695 | my $region = $params{region}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | $region = $params{bucket}->region | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | if $params{bucket} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | and Scalar::Util::blessed( $params{bucket} ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | and ! $params{region} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | and $params{bucket}->has_region | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 695 | ▶ | ; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
$params{"bucket"} and builtin::blessed($params{"bucket"}) and not $params{"region"} and $params{"bucket"}->has_region
$params{"bucket"} and builtin::blessed($params{"bucket"}) and not $params{"region"}
$params{"bucket"} and builtin::blessed($params{"bucket"})
MC/DC75%3/4
$params{"bucket"} and builtin::blessed($params{"bucket"}) and not $params{"region"} and $params{"bucket"}->has_region
$params{"bucket"}
builtin::blessed($params{"bucket"})
not $params{"region"}
$params{"bucket"}->has_region
Truth table80%4/5
A and B and not(C) and D
A= $params{"bucket"}B= builtin::blessed($params{"bucket"})C= not $params{"region"}D= $params{"bucket"}->has_region
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | $params{bucket} = $params{bucket}->name | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 695 | ▶ | if $params{bucket}->$Safe::Isa::_isa ('Net::Amazon::S3::Client::Bucket'); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | $params{bucket} = Net::Amazon::S3::Bucket->new( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | bucket => $params{bucket}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | account => $params{s3}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | (region => $region) x!! $region, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 695 | ▶ | ) if $params{bucket} and ! ref $params{bucket}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$params{"bucket"} and not ref $params{"bucket"}
MC/DC50%1/2
$params{"bucket"} and not ref $params{"bucket"}
$params{"bucket"}
not ref $params{"bucket"}
Truth table66%2/3
A and not(B)
A= $params{"bucket"}B= not ref $params{"bucket"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | 695 | delete $params{region}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 708 | $class->$orig( %params ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 99 | }; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 99 | has bucket => ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | is => 'ro', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | isa => 'Net::Amazon::S3::Bucket', | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | required => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 99 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||