neo4j-core 5.1.5 → 5.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aabfc0acca2ad7768f84194416b54c6c23513245
4
- data.tar.gz: f4607301d3679792123af774125d845238b247a4
3
+ metadata.gz: 7cf22ec9b38a45fc2f98e1c0f2a1c6590187233c
4
+ data.tar.gz: e5728703afe4dd48465091dcbbf1f5529e67fa59
5
5
  SHA512:
6
- metadata.gz: b09ca046ea647a741e2c0e37d4a929bcd5277da553a7cb0a247a3afdbe253d897fd172c03e82ea6b4e4119bb25f3d3ce80a651591a2dcc7fa29bc023111dcc49
7
- data.tar.gz: 2ba4176b3ed79a9560c112c04f29d92e359da8ebc177b40f0986a576de15f786eacdc10ee250211eb459653156313f41d9bce331a0a0ce50f0f53f9edbc8f19b
6
+ metadata.gz: 1b0f071af7269ad71c46a095bb1a77ff43bc707ceb36af82c61e40ca23c332b1eee23910fbba74ee2f2050bfd5f1827981b26e9202d708c9dd536c8abf44707c
7
+ data.tar.gz: 3dbb4b3c9113a35a719cff75f1236e9be03a397c52f1041a74a2d3ad9672ff0d7426c62c07425fe38511cf9a6788fcb7474b813fc6983e28748fd61539d92ae5
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = '5.1.5'
3
+ VERSION = '5.1.6'
4
4
  end
5
5
  end
@@ -86,20 +86,34 @@ module Neo4j
86
86
  end
87
87
 
88
88
  def hash_value_as_object(value, session)
89
- data = case
90
- when transaction_response?
91
- add_transaction_entity_id
92
- mapped_rest_data
93
- when value[:labels] || value[:type]
94
- add_entity_id(value)
95
- value
96
- else
97
- return value
98
- end
89
+ if transaction_response?
90
+ add_transaction_entity_id
91
+ data = mapped_rest_data
92
+ elsif [:node, :relationship].include?(identify_entity(value))
93
+ add_entity_id(value)
94
+ data = value
95
+ else
96
+ return value
97
+ end
98
+
99
99
  basic_obj = (node?(value) ? CypherNode : CypherRelationship).new(session, data)
100
100
  unwrapped? ? basic_obj : basic_obj.wrapper
101
101
  end
102
102
 
103
+ def identify_entity(data)
104
+ self_string = data[:self]
105
+ if self_string
106
+ type = self_string.split('/')[-2]
107
+ if type == 'node'
108
+ :node
109
+ elsif type == 'relationship'
110
+ :relationship
111
+ end
112
+ elsif [:nodes, :relationships, :start, :end, :length].all? { |k| data.key?(k) }
113
+ :path
114
+ end
115
+ end
116
+
103
117
  def looks_like_an_object?(value)
104
118
  if transaction_response?
105
119
  mapped_rest_data[:outgoing_relationships] || (mapped_rest_data[:start] && mapped_rest_data[:properties])
@@ -272,3 +286,4 @@ module Neo4j
272
286
  end
273
287
  end
274
288
  end
289
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.5
4
+ version: 5.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Ronge, Chris Grigg, Brian Underwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-26 00:00:00.000000000 Z
11
+ date: 2015-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty