blib/lib/Neo4j/Types/Path.pm untested

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 39 SCAR 30.0
CC
4
Cov
0%
elements
6.0
nodes
6.0
relationships
6.0
CRAP 20.0
1 use strict;
2 use warnings;
3  
4 package Neo4j::Types::Path;
5 # ABSTRACT: Represents a directed sequence of relationships between two nodes
6 $Neo4j::Types::Path::VERSION = '1.00';
7  
8 use Carp qw(croak);
9  
10  
11 sub elements {
12 my ($self) = @_;
13
14 croak 'elements() in scalar context not supported' unless wantarray;
15 return @$self;
16 }
17  
18  
19 sub nodes {
20 my ($self) = @_;
21
22 croak 'nodes() in scalar context not supported' unless wantarray;
23 my $i = 0;
24 return grep { ++$i & 1 } @$self;
25 }
26  
27  
28 sub relationships {
29 my ($self) = @_;
30
31 croak 'relationships() in scalar context not supported' unless wantarray;
32 my $i = 0;
33 return grep { $i++ & 1 } @$self;
34 }
35  
36  
37 1;
38  
39 __END__