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

filter: Statementstmt 0.0% 0 / 24 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 43 SCAR 34.0
CC
5
Cov
0%
labels
12.0
get
6.0
properties
6.0
CRAP 30.0
1 use strict;
2 use warnings;
3  
4 package Neo4j::Types::Node;
5 # ABSTRACT: Describes a node from a Neo4j graph
6 $Neo4j::Types::Node::VERSION = '1.00';
7  
8 use Carp qw(croak);
9  
10  
11 sub get {
12 my ($self, $property) = @_;
13
14 return unless defined $self->{properties};
15 return $self->{properties}->{$property};
16 }
17  
18  
19 sub id {
20 my ($self) = @_;
21
22 return $self->{id};
23 }
24  
25  
26 sub labels {
27 my ($self) = @_;
28
29 croak 'labels() in scalar context not supported' unless wantarray;
30 return unless defined $self->{labels};
31 return @{$self->{labels}};
32 }
33  
34  
35 sub properties {
36 my ($self) = @_;
37
38 return {} unless defined $self->{properties};
39 return $self->{properties};
40 }
41  
42  
43 1;
44  
45 __END__