File Coverage

lib/Neo4j/Types/Path.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 3 3 100.0
total 27 27 100.0


line stmt bran cond sub pod time code
1 2     2   1517 use v5.10.1;
  2         6  
2 2     2   9 use strict;
  2         2  
  2         72  
3 2     2   8 use warnings;
  2         4  
  2         436  
4              
5             package Neo4j::Types::Path;
6             # ABSTRACT: Represents a Neo4j path of nodes and relationships
7             $Neo4j::Types::Path::VERSION = '2.00';
8              
9              
10             sub elements {
11 6     6 1 41 my ($self) = @_;
12            
13 6         34 return @$self;
14             }
15              
16              
17             sub nodes {
18 6     6 1 41 my ($self) = @_;
19            
20 6         11 my $i = 0;
21 6         17 return grep { ++$i & 1 } @$self;
  14         52  
22             }
23              
24              
25             sub relationships {
26 6     6 1 39 my ($self) = @_;
27            
28 6         11 my $i = 0;
29 6         17 return grep { $i++ & 1 } @$self;
  14         38  
30             }
31              
32              
33             1;