Net/Amazon/S3/Operation/Buckets/List/Response.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 3 totaltotal 88.0% 22 / 25 CC 2 SCAR 2.9
CC
2
Cov
100%
_parse_data
2.0
BEGIN
1.0
owner_id
1.0
CRAP 1.3
« Net/Amazon/S3/Operation/Object/Upload/Part/Request.pm ↑ Summary Shared/Examples/Net/Amazon/S3/Fixture.pm »
1 package Net::Amazon::S3::Operation::Buckets::List::Response;
2 # ABSTRACT: An internal class to process list all buckets response
3 99 $Net::Amazon::S3::Operation::Buckets::List::Response::VERSION = '0.992';
4 99 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 99 extends 'Net::Amazon::S3::Response';
7  
8 4 ▶sub owner_id {
Subroutine owner_id: called CC=1 SCAR=0.0
Pod undocumented
9 4 $_[0]->_data->{owner_id};
10 }
11  
12 4 ▶sub owner_displayname {
Subroutine owner_displayname: called CC=1 SCAR=0.0
Pod undocumented
13 4 $_[0]->_data->{owner_displayname};
14 }
15  
16 4 ▶sub buckets {
Subroutine buckets: called CC=1 SCAR=0.0
Pod undocumented
17 4 @{ $_[0]->_data->{buckets} };
18 }
19  
20 4 ▶sub _parse_data {
Subroutine _parse_data: called CC=2 SCAR=6.9
21 4 my ($self) = @_;
22  
23 4 my $xpc = $self->xpath_context;
24  
25 4 my $data = {
26 owner_id => $xpc->findvalue ("/s3:ListAllMyBucketsResult/s3:Owner/s3:ID"),
27 owner_displayname => $xpc->findvalue ("/s3:ListAllMyBucketsResult/s3:Owner/s3:DisplayName"),
28 buckets => [],
29 };
30  
31 4 foreach my $node ($xpc->findnodes ("/s3:ListAllMyBucketsResult/s3:Buckets/s3:Bucket")) {
32 8 push @{ $data->{buckets} }, {
33 name => $xpc->findvalue ("./s3:Name", $node),
34 creation_date => $xpc->findvalue ("./s3:CreationDate", $node),
35 };
36 }
37  
38 4 return $data;
39 }
40  
41 99 1;
42  
43 __END__
« Net/Amazon/S3/Operation/Object/Upload/Part/Request.pm ↑ Summary Shared/Examples/Net/Amazon/S3/Fixture.pm »