File Coverage

blib/lib/Elasticsearch/Role/Client.pm
Criterion Covered Total %
statement 6 9 66.6
branch n/a
condition n/a
subroutine 2 3 66.6
pod 1 1 100.0
total 9 13 69.2


line stmt bran cond sub pod time code
1             package Elasticsearch::Role::Client;
2             $Elasticsearch::Role::Client::VERSION = '1.05';
3 42     42   42784 use Moo::Role;
  42         111  
  42         3672  
4 42     42   40029 use namespace::clean;
  42         111  
  42         327  
5              
6             requires 'parse_request';
7              
8             has 'transport' => ( is => 'ro', required => 1 );
9             has 'logger' => ( is => 'ro', required => 1 );
10              
11             #===================================
12             sub perform_request {
13             #===================================
14 0     0 1   my $self = shift;
15 0           my $request = $self->parse_request(@_);
16 0           return $self->transport->perform_request($request);
17             }
18              
19             1;
20              
21             =pod
22              
23             =encoding UTF-8
24              
25             =head1 NAME
26              
27             Elasticsearch::Role::Client - Provides common functionality for Client implementations
28              
29             =head1 VERSION
30              
31             version 1.05
32              
33             =head1 DESCRIPTION
34              
35             This role provides a common C<perform_request()> method for Client
36             implementations.
37              
38             =head1 METHODS
39              
40             =head2 C<perform_request()>
41              
42             This method takes whatever arguments it is passed and passes them directly to
43             a C<parse_request()> method (which should be provided by Client implementations).
44             The C<parse_request()> method should return a request suitable for passing
45             to L<Elasticsearch::Transport/perform_request()>.
46              
47             =head1 AUTHOR
48              
49             Clinton Gormley <drtech@cpan.org>
50              
51             =head1 COPYRIGHT AND LICENSE
52              
53             This software is Copyright (c) 2014 by Elasticsearch BV.
54              
55             This is free software, licensed under:
56              
57             The Apache License, Version 2.0, January 2004
58              
59             =cut
60              
61             __END__
62              
63             # ABSTRACT: Provides common functionality for Client implementations
64