File Coverage

blib/lib/OpenSearch/Parameters/Cluster/Stats.pm
Criterion Covered Total %
statement 15 16 93.7
branch n/a
condition n/a
subroutine 5 6 83.3
pod 0 1 0.0
total 20 23 86.9


line stmt bran cond sub pod time code
1             package OpenSearch::Parameters::Cluster::Stats;
2 4     4   3001 use strict;
  4         13  
  4         175  
3 4     4   24 use warnings;
  4         24  
  4         317  
4 4     4   31 use feature qw(state);
  4         10  
  4         561  
5 4     4   34 use Types::Standard qw(Str);
  4         9  
  4         37  
6 4     4   7428 use Moo::Role;
  4         12  
  4         40  
7              
8             with 'OpenSearch::Parameters';
9              
10             has 'nodes' => (
11             is => 'rw',
12             # TODO: may work if encode_func is applied to path arguments
13             #isa => InstanceOf['OpenSearch::Filter::Nodes'] | Str,
14             isa => Str
15             );
16              
17             around [qw/nodes/] => sub {
18             my $orig = shift;
19             my $self = shift;
20              
21             if (@_) {
22             $self->$orig(@_);
23             return ($self);
24             }
25             return ( $self->$orig );
26             };
27              
28             sub api_spec {
29 0     0 0   state $s = +{
30             nodes => {
31             encode_func => 'as_is',
32             type => 'path',
33             }
34             };
35             }
36              
37             1;