neo4j-core 7.1.2 → 7.2.0

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: 83b5add6c72001413e08b822272caf74810cb12a
4
- data.tar.gz: fd65a1c54329a3a032ed944d8b63c34489eab243
3
+ metadata.gz: e7a349a32447c684e13fa3712b4b6c886229e956
4
+ data.tar.gz: a0a5c7964efbee681b46b5c4f7d44f6b93f78e42
5
5
  SHA512:
6
- metadata.gz: fbd5749ef7c577360fb585e85065d5e075b7e016325f16e19e8e93ec44b01edbebfa950139477016564ff45df6eb7382a045e36be5b53dfa1d3efc38158104b6
7
- data.tar.gz: d99510d9b64a5c987e09241713b48e1eec3b0c8096fd6ee4c8e997f6b25cf0ac1b55214e1dc41b4906a9781e3db48b82d168b06a1830fd4c322b8ec786293517
6
+ metadata.gz: ba6151f2678bb163439b21846d0377fd1126397f9f7e01f6052cced6e7a900d55d25e46fbe834e93b9502d27f723ed650a5b6fdf73390febf2628bd3ed523ca3
7
+ data.tar.gz: c3b4a9c49985e8793c356a170c94b6d18ac6902533ee54f40587d2c04b0176654e6f8370efb66c9f6bb079c206ab840041bfd26cb3c20fc9b4b80f8f6938c823
@@ -111,11 +111,7 @@ module Neo4j
111
111
  def attributes_from_key_and_value(_key, value)
112
112
  return nil unless value.is_a?(Hash)
113
113
 
114
- if value.values.map(&:class) == [Hash]
115
- value.first[1]
116
- else
117
- value
118
- end
114
+ value.values.map(&:class) == [Hash] ? value.first[1] : value
119
115
  end
120
116
 
121
117
  class << self
@@ -166,11 +162,7 @@ module Neo4j
166
162
  end
167
163
 
168
164
  def from_key_and_single_value(key, value)
169
- if value.to_sym == :neo_id
170
- "ID(#{key})"
171
- else
172
- "#{key}.#{value}"
173
- end
165
+ value.to_sym == :neo_id ? "ID(#{key})" : "#{key}.#{value}"
174
166
  end
175
167
  end
176
168
 
@@ -196,19 +188,21 @@ module Neo4j
196
188
  self.class.paramaterize_key!(param)
197
189
 
198
190
  if value.is_a?(Range)
199
- min_param, max_param = add_params("#{param}_range_min" => value.min, "#{param}_range_max" => value.max)
200
-
201
- "#{key} IN RANGE({#{min_param}}, {#{max_param}})"
191
+ range_key_value_string(key, value, previous_keys, param)
202
192
  else
203
193
  value = value.first if array_value?(value, is_set) && value.size == 1
204
- operator = array_value?(value, is_set) ? 'IN' : '='
205
194
 
206
195
  param = add_param(param, value)
207
196
 
208
- "#{key} #{operator} {#{param}}"
197
+ "#{key} #{array_value?(value, is_set) ? 'IN' : '='} {#{param}}"
209
198
  end
210
199
  end
211
200
 
201
+ def range_key_value_string(key, value, previous_keys, param)
202
+ begin_param, end_param = add_params("#{param}_range_min" => value.begin, "#{param}_range_max" => value.end)
203
+ "#{key} >= {#{begin_param}} AND #{previous_keys[-2]}.#{key} <#{'=' unless value.exclude_end?} {#{end_param}}"
204
+ end
205
+
212
206
  def array_value?(value, is_set)
213
207
  value.is_a?(Array) && !is_set
214
208
  end
@@ -281,7 +275,6 @@ module Neo4j
281
275
  when Hash then hash_key_value_string(key, value, previous_keys)
282
276
  when NilClass then "#{key} IS NULL"
283
277
  when Regexp then regexp_key_value_string(key, value, previous_keys)
284
- when Array, Range then key_value_string(key, value, previous_keys)
285
278
  else
286
279
  key_value_string(key, value, previous_keys)
287
280
  end
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module Core
3
- VERSION = '7.1.2'
3
+ VERSION = '7.2.0'
4
4
  end
5
5
  end
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: 7.1.2
4
+ version: 7.2.0
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: 2017-05-05 00:00:00.000000000 Z
11
+ date: 2017-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday