Data/Riak/Request/LinkWalk.pm untested

filter: Statementstmt 0.0% 0 / 27 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 35 CC 2 SCAR 12.8
CC
2
Cov
0%
as_http_request_args
6.0
_build_http_exception_classes
2.0
BEGIN
2.0
CRAP 3.6
1 package Data::Riak::Request::LinkWalk;
2 {
3 $Data::Riak::Request::LinkWalk::VERSION = '2.0';
4 }
5  
6 use Moose;
7 use namespace::autoclean;
8  
9 has params => (
10 is => 'ro',
11 isa => 'ArrayRef',
12 required => 1,
13 );
14  
15 sub as_http_request_args {
16 my ($self) = @_;
17  
18 my $params = $self->params;
19 my $params_str = '';
20  
21 for my $depth (@$params) {
22 if(@{ $depth } == 2) {
23 unshift @{ $depth }, $self->bucket_name;
24 }
25 my ($buck, $tag, $keep) = @{$depth};
26 $params_str .= "$buck,$tag,$keep/";
27 }
28  
29 return {
30 method => 'GET',
31 uri => sprintf('buckets/%s/keys/%s/%s',
32 $self->bucket_name, $self->key, $params_str),
33 };
34 }
35  
36 sub _build_http_exception_classes {
37 return {
38 404 => Data::Riak::Exception::ObjectNotFound::,
39 };
40 }
41  
42 with 'Data::Riak::Request::WithObject',
43 'Data::Riak::Request::WithHTTPExceptionHandling';
44  
45 has '+result_class' => (
46 default => Data::Riak::Result::Object::,
47 );
48  
49 __PACKAGE__->meta->make_immutable;
50  
51 1;
52  
53 __END__