File Coverage

blib/lib/OpenSearch/Document/Index.pm
Criterion Covered Total %
statement 18 23 78.2
branch 0 6 0.0
condition n/a
subroutine 6 7 85.7
pod 0 1 0.0
total 24 37 64.8


line stmt bran cond sub pod time code
1             package OpenSearch::Document::Index;
2 4     4   28 use strict;
  4         9  
  4         173  
3 4     4   19 use warnings;
  4         25  
  4         246  
4 4     4   26 use Moo;
  4         13  
  4         35  
5 4     4   1748 use Types::Standard qw(InstanceOf);
  4         10  
  4         32  
6 4     4   6921 use feature qw(signatures);
  4         10  
  4         673  
7 4     4   28 no warnings qw(experimental::signatures);
  4         25  
  4         862  
8              
9             with 'OpenSearch::Parameters::Document::Index';
10              
11             has '_base' => (
12             is => 'rw',
13             isa => InstanceOf['OpenSearch::Base'],
14             required => 1,
15             );
16              
17 0     0 0   sub execute($self) {
  0            
  0            
18 0 0         my $method = $self->id ? '_put' : '_post';
19 0 0         my $res = $self->_base->$method( $self,
    0          
20             [ $self->index, ( $self->create ? '_create' : '_doc' ), ( $self->id ? $self->id : () ) ] );
21             }
22              
23              
24             1;