Data/Riak/Request/MapReduce.pm untested

filter: Statementstmt 0.0% 0 / 29 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 41 CC 2 SCAR 10.6
CC
2
Cov
0%
as_http_request_args
6.0
_build_http_exception_classes
2.0
BEGIN
2.0
CRAP 2.9
1 package Data::Riak::Request::MapReduce;
2 {
3 $Data::Riak::Request::MapReduce::VERSION = '2.0';
4 }
5  
6 use Moose;
7 use Data::Riak::Result::Object;
8 use Data::Riak::Exception::FunctionFailed;
9 use Data::Riak::Exception::Timeout;
10 use JSON 'encode_json';
11 use namespace::autoclean;
12  
13 has data => (
14 is => 'ro',
15 isa => 'HashRef',
16 required => 1,
17 );
18  
19 has chunked => (
20 is => 'ro',
21 isa => 'Bool',
22 default => 0,
23 );
24  
25 sub as_http_request_args {
26 my ($self) = @_;
27  
28 return +{
29 method => 'POST',
30 uri => 'mapred',
31 content_type => 'application/json',
32 data => encode_json($self->data),
33 ($self->chunked ? (query => { chunked => 'true' }) : ()),
34 };
35 }
36  
37 sub _build_http_exception_classes {
38 return {
39 500 => Data::Riak::Exception::FunctionFailed::,
40 503 => Data::Riak::Exception::Timeout::,
41 };
42 }
43  
44 with 'Data::Riak::Request',
45 'Data::Riak::Request::WithHTTPExceptionHandling';
46  
47 __PACKAGE__->meta->make_immutable;
48  
49 1;
50  
51 __END__