File Coverage

lib/Neo4j/Driver/Type/Path.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 3 3 100.0
total 30 30 100.0


line stmt bran cond sub pod time code
1 20     20   299 use v5.12;
  20         79  
2 20     20   143 use warnings;
  20         43  
  20         1881  
3              
4             package Neo4j::Driver::Type::Path 1.02;
5             # ABSTRACT: Directed sequence of relationships between two nodes
6              
7              
8             # For documentation, see Neo4j::Driver::Types.
9              
10              
11 20     20   138 use parent 'Neo4j::Types::Path';
  20         47  
  20         123  
12              
13              
14             sub nodes {
15 13     13 1 13773 my ($self) = @_;
16            
17 13         26 my $i = 0;
18 13         25 return grep { ++$i & 1 } @{$self->{'..'}};
  41         130  
  13         43  
19             }
20              
21              
22             sub relationships {
23 11     11 1 10616 my ($self) = @_;
24            
25 11         47 my $i = 0;
26 11         18 return grep { $i++ & 1 } @{$self->{'..'}};
  35         110  
  11         33  
27             }
28              
29              
30             sub elements {
31 9     9 1 6084 my ($self) = @_;
32            
33 9         17 return @{$self->{'..'}};
  9         50  
34             }
35              
36              
37             1;