Search/Elasticsearch/Plugin/Langdetect/API.pm untested

filter: Statementstmt 0.0% 0 / 26 Branchbran n/a Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 41 CC 1 SCAR 6.9
CC
1
Cov
0%
api
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package Search::Elasticsearch::Plugin::Langdetect::API;
2 use vars qw($VERSION);
3 $VERSION = '0.06';
4  
5 use Moo::Role;
6  
7 use Search::Elasticsearch::Util qw(throw);
8 use Search::Elasticsearch::Util::API::QS qw(qs_init);
9 use namespace::clean;
10  
11 our %API;
12  
13 #===================================
14 sub api {
15 #===================================
16 my $name = $_[1] || return \%API;
17 return $API{$name}
18 || throw( 'Internal', "Unknown api name ($name)" );
19 }
20  
21 #===================================
22 %API = (
23 #===================================
24  
25 #=== AUTOGEN - START ===
26  
27 'langdetect.detect_languages' => {
28 method => "POST",
29 parts => {},
30 paths => [ [ {}, "_langdetect" ] ],
31 body => { required => 1 },
32 },
33  
34 #'langdetect.detect_language' => {
35 # method => "POST",
36 # parts => {},
37 # paths => [ [ {}, "_langdetect" ] ],
38 # body => { required => 1 },
39 #},
40 );
41  
42 for ( values %API ) {
43 $_->{qs_handlers} = qs_init( @{ $_->{qs} } );
44 }
45  
46 1;1;