couchbase 3.0.0.beta.1-universal-darwin-19 → 3.0.0-universal-darwin-19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +227 -0
  3. data/.rubocop_todo.yml +47 -0
  4. data/CONTRIBUTING.md +110 -0
  5. data/Gemfile +4 -0
  6. data/README.md +3 -3
  7. data/Rakefile +1 -1
  8. data/couchbase.gemspec +40 -39
  9. data/examples/analytics.rb +123 -108
  10. data/examples/auth.rb +33 -0
  11. data/examples/crud.rb +16 -2
  12. data/examples/managing_analytics_indexes.rb +18 -4
  13. data/examples/managing_buckets.rb +17 -3
  14. data/examples/managing_collections.rb +22 -9
  15. data/examples/managing_query_indexes.rb +38 -18
  16. data/examples/managing_search_indexes.rb +21 -6
  17. data/examples/managing_view_indexes.rb +18 -4
  18. data/examples/query.rb +17 -3
  19. data/examples/query_with_consistency.rb +30 -20
  20. data/examples/search.rb +116 -101
  21. data/examples/search_with_consistency.rb +43 -30
  22. data/examples/subdocument.rb +42 -30
  23. data/examples/view.rb +19 -10
  24. data/ext/CMakeLists.txt +40 -2
  25. data/ext/build_version.hxx.in +1 -1
  26. data/ext/couchbase/bucket.hxx +190 -38
  27. data/ext/couchbase/cluster.hxx +22 -4
  28. data/ext/couchbase/configuration.hxx +14 -14
  29. data/ext/couchbase/couchbase.cxx +108 -12
  30. data/ext/couchbase/error_map.hxx +202 -2
  31. data/ext/couchbase/errors.hxx +8 -2
  32. data/ext/couchbase/io/dns_client.hxx +6 -6
  33. data/ext/couchbase/io/http_command.hxx +2 -2
  34. data/ext/couchbase/io/http_session.hxx +7 -11
  35. data/ext/couchbase/io/http_session_manager.hxx +3 -3
  36. data/ext/couchbase/io/mcbp_command.hxx +101 -44
  37. data/ext/couchbase/io/mcbp_session.hxx +144 -49
  38. data/ext/couchbase/io/retry_action.hxx +30 -0
  39. data/ext/couchbase/io/retry_context.hxx +39 -0
  40. data/ext/couchbase/io/retry_orchestrator.hxx +96 -0
  41. data/ext/couchbase/io/retry_reason.hxx +235 -0
  42. data/ext/couchbase/io/retry_strategy.hxx +156 -0
  43. data/ext/couchbase/operations/document_decrement.hxx +2 -0
  44. data/ext/couchbase/operations/document_exists.hxx +2 -0
  45. data/ext/couchbase/operations/document_get.hxx +2 -0
  46. data/ext/couchbase/operations/document_get_and_lock.hxx +2 -0
  47. data/ext/couchbase/operations/document_get_and_touch.hxx +2 -0
  48. data/ext/couchbase/operations/document_get_projected.hxx +2 -0
  49. data/ext/couchbase/operations/document_increment.hxx +2 -0
  50. data/ext/couchbase/operations/document_insert.hxx +2 -0
  51. data/ext/couchbase/operations/document_lookup_in.hxx +2 -0
  52. data/ext/couchbase/operations/document_mutate_in.hxx +3 -0
  53. data/ext/couchbase/operations/document_query.hxx +10 -0
  54. data/ext/couchbase/operations/document_remove.hxx +2 -0
  55. data/ext/couchbase/operations/document_replace.hxx +2 -0
  56. data/ext/couchbase/operations/document_search.hxx +8 -3
  57. data/ext/couchbase/operations/document_touch.hxx +2 -0
  58. data/ext/couchbase/operations/document_unlock.hxx +2 -0
  59. data/ext/couchbase/operations/document_upsert.hxx +2 -0
  60. data/ext/couchbase/operations/query_index_create.hxx +14 -4
  61. data/ext/couchbase/operations/query_index_drop.hxx +12 -2
  62. data/ext/couchbase/operations/query_index_get_all.hxx +11 -2
  63. data/ext/couchbase/origin.hxx +47 -17
  64. data/ext/couchbase/platform/backtrace.c +189 -0
  65. data/ext/couchbase/platform/backtrace.h +54 -0
  66. data/ext/couchbase/platform/terminate_handler.cc +122 -0
  67. data/ext/couchbase/platform/terminate_handler.h +36 -0
  68. data/ext/couchbase/protocol/cmd_get_cluster_config.hxx +6 -1
  69. data/ext/couchbase/protocol/status.hxx +14 -4
  70. data/ext/couchbase/version.hxx +2 -2
  71. data/ext/extconf.rb +39 -36
  72. data/ext/test/main.cxx +64 -16
  73. data/lib/couchbase.rb +0 -1
  74. data/lib/couchbase/analytics_options.rb +2 -4
  75. data/lib/couchbase/authenticator.rb +14 -0
  76. data/lib/couchbase/binary_collection.rb +9 -9
  77. data/lib/couchbase/binary_collection_options.rb +8 -6
  78. data/lib/couchbase/bucket.rb +18 -18
  79. data/lib/couchbase/cluster.rb +121 -90
  80. data/lib/couchbase/collection.rb +36 -38
  81. data/lib/couchbase/collection_options.rb +31 -17
  82. data/lib/couchbase/common_options.rb +1 -1
  83. data/lib/couchbase/datastructures/couchbase_list.rb +16 -16
  84. data/lib/couchbase/datastructures/couchbase_map.rb +18 -18
  85. data/lib/couchbase/datastructures/couchbase_queue.rb +13 -13
  86. data/lib/couchbase/datastructures/couchbase_set.rb +8 -7
  87. data/lib/couchbase/errors.rb +10 -3
  88. data/lib/couchbase/json_transcoder.rb +2 -2
  89. data/lib/couchbase/libcouchbase.bundle +0 -0
  90. data/lib/couchbase/management/analytics_index_manager.rb +37 -37
  91. data/lib/couchbase/management/bucket_manager.rb +25 -25
  92. data/lib/couchbase/management/collection_manager.rb +3 -3
  93. data/lib/couchbase/management/query_index_manager.rb +59 -14
  94. data/lib/couchbase/management/search_index_manager.rb +15 -12
  95. data/lib/couchbase/management/user_manager.rb +1 -1
  96. data/lib/couchbase/management/view_index_manager.rb +11 -5
  97. data/lib/couchbase/mutation_state.rb +12 -0
  98. data/lib/couchbase/query_options.rb +23 -9
  99. data/lib/couchbase/scope.rb +61 -1
  100. data/lib/couchbase/search_options.rb +40 -27
  101. data/lib/couchbase/subdoc.rb +31 -28
  102. data/lib/couchbase/version.rb +2 -2
  103. data/lib/couchbase/view_options.rb +0 -1
  104. metadata +20 -7
@@ -22,7 +22,7 @@ module Couchbase
22
22
  attr_reader :scope_name
23
23
  attr_reader :name
24
24
 
25
- alias_method :inspect, :to_s
25
+ alias inspect to_s
26
26
 
27
27
  # @param [Couchbase::Backend] backend
28
28
  # @param [String] bucket_name name of the bucket
@@ -140,7 +140,7 @@ module Couchbase
140
140
  # @return [MutationResult]
141
141
  def remove(id, options = RemoveOptions.new)
142
142
  resp = @backend.document_remove(bucket_name, "#{@scope_name}.#{@name}", id, options.timeout, {
143
- durability_level: options.durability_level
143
+ durability_level: options.durability_level,
144
144
  })
145
145
  MutationResult.new do |res|
146
146
  res.cas = resp[:cas]
@@ -158,8 +158,8 @@ module Couchbase
158
158
  def insert(id, content, options = InsertOptions.new)
159
159
  blob, flags = options.transcoder.encode(content)
160
160
  resp = @backend.document_insert(bucket_name, "#{@scope_name}.#{@name}", id, options.timeout, blob, flags, {
161
- durability_level: options.durability_level,
162
- expiry: options.expiry,
161
+ durability_level: options.durability_level,
162
+ expiry: options.expiry,
163
163
  })
164
164
  MutationResult.new do |res|
165
165
  res.cas = resp[:cas]
@@ -177,8 +177,8 @@ module Couchbase
177
177
  def upsert(id, content, options = UpsertOptions.new)
178
178
  blob, flags = options.transcoder.encode(content)
179
179
  resp = @backend.document_upsert(bucket_name, "#{@scope_name}.#{@name}", id, options.timeout, blob, flags, {
180
- durability_level: options.durability_level,
181
- expiry: options.expiry,
180
+ durability_level: options.durability_level,
181
+ expiry: options.expiry,
182
182
  })
183
183
  MutationResult.new do |res|
184
184
  res.cas = resp[:cas]
@@ -196,9 +196,9 @@ module Couchbase
196
196
  def replace(id, content, options = ReplaceOptions.new)
197
197
  blob, flags = options.transcoder.encode(content)
198
198
  resp = @backend.document_replace(bucket_name, "#{@scope_name}.#{@name}", id, options.timeout, blob, flags, {
199
- durability_level: options.durability_level,
200
- expiry: options.expiry,
201
- cas: options.cas,
199
+ durability_level: options.durability_level,
200
+ expiry: options.expiry,
201
+ cas: options.cas,
202
202
  })
203
203
  MutationResult.new do |res|
204
204
  res.cas = resp[:cas]
@@ -240,14 +240,14 @@ module Couchbase
240
240
  # @return [LookupInResult]
241
241
  def lookup_in(id, specs, options = LookupInOptions.new)
242
242
  resp = @backend.document_lookup_in(
243
- bucket_name, "#{@scope_name}.#{@name}", id, options.timeout, options.access_deleted,
244
- specs.map { |s|
245
- {
246
- opcode: s.type,
247
- xattr: s.xattr?,
248
- path: s.path
249
- }
243
+ bucket_name, "#{@scope_name}.#{@name}", id, options.timeout, options.access_deleted,
244
+ specs.map do |s|
245
+ {
246
+ opcode: s.type,
247
+ xattr: s.xattr?,
248
+ path: s.path,
250
249
  }
250
+ end
251
251
  )
252
252
  LookupInResult.new do |res|
253
253
  res.transcoder = options.transcoder
@@ -275,26 +275,26 @@ module Couchbase
275
275
  # @return [MutateInResult]
276
276
  def mutate_in(id, specs, options = MutateInOptions.new)
277
277
  resp = @backend.document_mutate_in(
278
- bucket_name, "#{@scope_name}.#{@name}", id, options.timeout,
279
- specs.map { |s|
280
- {
281
- opcode: s.type,
282
- path: s.path,
283
- param: s.param,
284
- xattr: s.xattr?,
285
- expand_macros: s.expand_macros?,
286
- create_path: s.create_path?
287
- }
288
- },
278
+ bucket_name, "#{@scope_name}.#{@name}", id, options.timeout,
279
+ specs.map do |s|
289
280
  {
290
- durability_level: options.durability_level,
291
- store_semantics: options.store_semantics,
292
- access_deleted: options.access_deleted,
293
- cas: options.cas,
294
- expiry: options.expiry,
281
+ opcode: s.type,
282
+ path: s.path,
283
+ param: s.param,
284
+ xattr: s.xattr?,
285
+ expand_macros: s.expand_macros?,
286
+ create_path: s.create_path?,
295
287
  }
288
+ end,
289
+ {
290
+ durability_level: options.durability_level,
291
+ store_semantics: options.store_semantics,
292
+ access_deleted: options.access_deleted,
293
+ cas: options.cas,
294
+ expiry: options.expiry,
295
+ }
296
296
  )
297
- res = MutateInResult.new do |res|
297
+ result = MutateInResult.new do |res|
298
298
  res.transcoder = options.transcoder
299
299
  res.cas = resp[:cas]
300
300
  res.mutation_token = extract_mutation_token(resp)
@@ -310,11 +310,9 @@ module Couchbase
310
310
  end
311
311
  end
312
312
  end
313
- if res.success?
314
- res
315
- else
316
- raise res.first_error
317
- end
313
+ raise result.first_error unless result.success?
314
+
315
+ result
318
316
  end
319
317
 
320
318
  private
@@ -28,6 +28,7 @@ module Couchbase
28
28
 
29
29
  # @yieldparam [GetOptions] self
30
30
  def initialize
31
+ super
31
32
  @transcoder = JsonTranscoder.new
32
33
  @preserve_array_indexes = false
33
34
  @with_expiry = nil
@@ -67,6 +68,7 @@ module Couchbase
67
68
 
68
69
  # @yieldparam [GetAndLockOptions] self
69
70
  def initialize
71
+ super
70
72
  @transcoder = JsonTranscoder.new
71
73
  yield self if block_given?
72
74
  end
@@ -78,6 +80,7 @@ module Couchbase
78
80
 
79
81
  # @yieldparam [GetAndTouchOptions] self
80
82
  def initialize
83
+ super
81
84
  @transcoder = JsonTranscoder.new
82
85
  yield self if block_given?
83
86
  end
@@ -122,6 +125,7 @@ module Couchbase
122
125
 
123
126
  # @yieldparam [GetAllReplicasOptions] self
124
127
  def initialize
128
+ super
125
129
  yield self if block_given?
126
130
  end
127
131
  end
@@ -132,6 +136,7 @@ module Couchbase
132
136
 
133
137
  # @yieldparam [GetAnyReplicaOptions] self
134
138
  def initialize
139
+ super
135
140
  yield self if block_given?
136
141
  end
137
142
  end
@@ -139,12 +144,13 @@ module Couchbase
139
144
  class GetReplicaResult < GetResult
140
145
  # @return [Boolean] true if this result came from a replica
141
146
  attr_accessor :is_replica
142
- alias_method :replica?, :is_replica
147
+ alias replica? is_replica
143
148
  end
144
149
 
145
150
  class ExistsOptions < CommonOptions
146
151
  # @yieldparam [ExistsOptions] self
147
152
  def initialize
153
+ super
148
154
  yield self if block_given?
149
155
  end
150
156
  end
@@ -181,6 +187,7 @@ module Couchbase
181
187
 
182
188
  # @yieldparam [RemoveOptions]
183
189
  def initialize
190
+ super
184
191
  @durability_level = :none
185
192
  yield self if block_given?
186
193
  end
@@ -198,6 +205,7 @@ module Couchbase
198
205
 
199
206
  # @yieldparam [InsertOptions]
200
207
  def initialize
208
+ super
201
209
  @transcoder = JsonTranscoder.new
202
210
  @durability_level = :none
203
211
  yield self if block_given?
@@ -216,6 +224,7 @@ module Couchbase
216
224
 
217
225
  # @yieldparam [UpsertOptions]
218
226
  def initialize
227
+ super
219
228
  @transcoder = JsonTranscoder.new
220
229
  @durability_level = :none
221
230
  yield self if block_given?
@@ -237,6 +246,7 @@ module Couchbase
237
246
 
238
247
  # @yieldparam [ReplaceOptions]
239
248
  def initialize
249
+ super
240
250
  @transcoder = JsonTranscoder.new
241
251
  @durability_level = :none
242
252
  yield self if block_given?
@@ -259,6 +269,7 @@ module Couchbase
259
269
  class TouchOptions < CommonOptions
260
270
  # @yieldparam [TouchOptions] self
261
271
  def initialize
272
+ super
262
273
  yield self if block_given?
263
274
  end
264
275
  end
@@ -266,6 +277,7 @@ module Couchbase
266
277
  class UnlockOptions < CommonOptions
267
278
  # @yieldparam [UnlockOptions] self
268
279
  def initialize
280
+ super
269
281
  yield self if block_given?
270
282
  end
271
283
  end
@@ -279,6 +291,7 @@ module Couchbase
279
291
 
280
292
  # @yieldparam [LookupInOptions] self
281
293
  def initialize
294
+ super
282
295
  @transcoder = JsonTranscoder.new
283
296
  yield self if block_given?
284
297
  end
@@ -320,13 +333,12 @@ module Couchbase
320
333
  private
321
334
 
322
335
  def get_field_at_index(index)
323
- if index >= 0 && index < encoded.size
324
- field = encoded[index]
325
- raise field.error unless field.success?
326
- field
327
- else
328
- raise Error::PathInvalid, "Index is out of bounds: #{index}"
329
- end
336
+ raise Error::PathInvalid, "Index is out of bounds: #{index}" unless index >= 0 && index < encoded.size
337
+
338
+ field = encoded[index]
339
+ raise field.error unless field.success?
340
+
341
+ field
330
342
  end
331
343
  end
332
344
 
@@ -357,6 +369,7 @@ module Couchbase
357
369
 
358
370
  # @yieldparam [MutateInOptions]
359
371
  def initialize
372
+ super
360
373
  @durability_level = :none
361
374
  @store_semantics = :replace
362
375
  @transcoder = JsonTranscoder.new
@@ -383,6 +396,7 @@ module Couchbase
383
396
 
384
397
  # @yieldparam [MutateInResult] self
385
398
  def initialize
399
+ super
386
400
  yield self if block_given?
387
401
  end
388
402
 
@@ -393,7 +407,7 @@ module Couchbase
393
407
 
394
408
  # @api private
395
409
  def first_error
396
- encoded[first_error_index].error
410
+ encoded[first_error_index].error unless success?
397
411
  end
398
412
 
399
413
  # @return [Array<SubDocumentField>] holds the encoded subdocument responses
@@ -410,13 +424,12 @@ module Couchbase
410
424
  private
411
425
 
412
426
  def get_field_at_index(index)
413
- if index >= 0 && index < encoded.size
414
- field = encoded[index]
415
- raise field.error unless field.success?
416
- field
417
- else
418
- raise Error::PathInvalid, "Index is out of bounds: #{index}"
419
- end
427
+ raise Error::PathInvalid, "Index is out of bounds: #{index}" unless index >= 0 && index < encoded.size
428
+
429
+ field = encoded[index]
430
+ raise field.error unless field.success?
431
+
432
+ field
420
433
  end
421
434
  end
422
435
 
@@ -458,7 +471,8 @@ module Couchbase
458
471
  #
459
472
  # [+:success+] Indicates a successful response in general.
460
473
  # [+:path_not_found+] The provided path does not exist in the document
461
- # [+:path_mismatch+] One of path components treats a non-dictionary as a dictionary, or a non-array as an array, or value the path points to is not a number
474
+ # [+:path_mismatch+] One of path components treats a non-dictionary as a dictionary, or a non-array as an array, or value the path
475
+ # points to is not a number
462
476
  # [+:path_invalid+] The path's syntax was incorrect
463
477
  # [+:path_too_big+] The path provided is too large: either the string is too long, or it contains too many components
464
478
  # [+:value_cannot_insert+] The value provided will invalidate the JSON if inserted
@@ -26,4 +26,4 @@ module Couchbase
26
26
  # @return [Span] If set holds the parent span, that should be used for this request
27
27
  attr_accessor :parent_span
28
28
  end
29
- end
29
+ end
@@ -63,14 +63,14 @@ module Couchbase
63
63
  # @return [Integer] returns the number of elements in the list.
64
64
  def length
65
65
  result = @collection.lookup_in(@id, [
66
- LookupInSpec.count("")
67
- ], @options.lookup_in_options)
66
+ LookupInSpec.count(""),
67
+ ], @options.lookup_in_options)
68
68
  result.content(0)
69
69
  rescue Error::DocumentNotFound
70
70
  0
71
71
  end
72
72
 
73
- alias_method :size, :length
73
+ alias size length
74
74
 
75
75
  # @return [Boolean] returns true if list is empty
76
76
  def empty?
@@ -84,12 +84,12 @@ module Couchbase
84
84
  # @return [CouchbaseList]
85
85
  def push(*obj)
86
86
  @collection.mutate_in(@id, [
87
- MutateInSpec.array_append("", obj)
88
- ], @options.mutate_in_options)
87
+ MutateInSpec.array_append("", obj),
88
+ ], @options.mutate_in_options)
89
89
  self
90
90
  end
91
91
 
92
- alias_method :append, :push
92
+ alias append push
93
93
 
94
94
  # Prepends objects to the front of the list, moving other elements upwards
95
95
  #
@@ -97,12 +97,12 @@ module Couchbase
97
97
  # @return [CouchbaseList]
98
98
  def unshift(*obj)
99
99
  @collection.mutate_in(@id, [
100
- MutateInSpec.array_prepend("", obj)
101
- ], @options.mutate_in_options)
100
+ MutateInSpec.array_prepend("", obj),
101
+ ], @options.mutate_in_options)
102
102
  self
103
103
  end
104
104
 
105
- alias_method :prepend, :unshift
105
+ alias prepend unshift
106
106
 
107
107
  # Inserts the given values before the element with the given +index+.
108
108
  #
@@ -111,8 +111,8 @@ module Couchbase
111
111
  # @return [CouchbaseList]
112
112
  def insert(index, *obj)
113
113
  @collection.mutate_in(@id, [
114
- MutateInSpec.array_insert("[#{index.to_i}]", obj)
115
- ])
114
+ MutateInSpec.array_insert("[#{index.to_i}]", obj),
115
+ ])
116
116
  self
117
117
  end
118
118
 
@@ -122,14 +122,14 @@ module Couchbase
122
122
  # @return [Object, nil]
123
123
  def at(index)
124
124
  result = @collection.lookup_in(@id, [
125
- LookupInSpec.get("[#{index.to_i}]")
126
- ], @options.lookup_in_options)
125
+ LookupInSpec.get("[#{index.to_i}]"),
126
+ ], @options.lookup_in_options)
127
127
  result.exists?(0) ? result.content(0) : nil
128
128
  rescue Error::DocumentNotFound
129
129
  nil
130
130
  end
131
131
 
132
- alias_method :[], :at
132
+ alias [] at
133
133
 
134
134
  # Deletes the element at the specified +index+, returning that element, or nil
135
135
  #
@@ -137,8 +137,8 @@ module Couchbase
137
137
  # @return [CouchbaseList]
138
138
  def delete_at(index)
139
139
  @collection.mutate_in(@id, [
140
- MutateInSpec.remove("[#{index.to_i}]")
141
- ])
140
+ MutateInSpec.remove("[#{index.to_i}]"),
141
+ ])
142
142
  self
143
143
  rescue Error::DocumentNotFound
144
144
  self
@@ -63,14 +63,14 @@ module Couchbase
63
63
  # @return [Integer] returns the number of elements in the map.
64
64
  def length
65
65
  result = @collection.lookup_in(@id, [
66
- LookupInSpec.count("")
67
- ], @options.lookup_in_options)
66
+ LookupInSpec.count(""),
67
+ ], @options.lookup_in_options)
68
68
  result.content(0)
69
69
  rescue Error::DocumentNotFound
70
70
  0
71
71
  end
72
72
 
73
- alias_method :size, :length
73
+ alias size length
74
74
 
75
75
  # @return [Boolean] returns true if map is empty
76
76
  def empty?
@@ -110,12 +110,13 @@ module Couchbase
110
110
  # @return [Object]
111
111
  def fetch(key, *rest)
112
112
  result = @collection.lookup_in(@id, [
113
- LookupInSpec.get(key)
114
- ], @options.lookup_in_options)
113
+ LookupInSpec.get(key),
114
+ ], @options.lookup_in_options)
115
115
  result.content(0)
116
116
  rescue Error::DocumentNotFound, Error::PathNotFound
117
117
  return yield if block_given?
118
- return rest.first if rest.size > 0
118
+ return rest.first unless rest.empty?
119
+
119
120
  raise KeyError, "key not found: #{key}"
120
121
  end
121
122
 
@@ -135,12 +136,11 @@ module Couchbase
135
136
  # @param [String] key
136
137
  # @param [Object] value
137
138
  #
138
- # @return Object
139
+ # @return [void]
139
140
  def []=(key, value)
140
141
  @collection.mutate_in(@id, [
141
- MutateInSpec.upsert(key, value)
142
- ], @options.mutate_in_options)
143
- value
142
+ MutateInSpec.upsert(key, value),
143
+ ], @options.mutate_in_options)
144
144
  end
145
145
 
146
146
  # Deletes the key-value pair from the map.
@@ -150,8 +150,8 @@ module Couchbase
150
150
  # @return void
151
151
  def delete(key)
152
152
  @collection.mutate_in(@id, [
153
- MutateInSpec.remove(key)
154
- ])
153
+ MutateInSpec.remove(key),
154
+ ])
155
155
  rescue Error::DocumentNotFound, Error::PathNotFound
156
156
  nil
157
157
  end
@@ -162,28 +162,28 @@ module Couchbase
162
162
  # @return [Boolean]
163
163
  def key?(key)
164
164
  result = @collection.lookup_in(@id, [
165
- LookupInSpec.exists(key)
166
- ], @options.lookup_in_options)
165
+ LookupInSpec.exists(key),
166
+ ], @options.lookup_in_options)
167
167
  result.exists?(0)
168
168
  rescue Error::DocumentNotFound, Error::PathNotFound
169
169
  false
170
170
  end
171
171
 
172
- alias_method :member?, :key?
173
- alias_method :include?, :key?
172
+ alias member? key?
173
+ alias include? key?
174
174
 
175
175
  # Returns a new array populated with the keys from the map.
176
176
  #
177
177
  # @return [Array]
178
178
  def keys
179
- map {|key, _value| key}
179
+ map { |key, _value| key }
180
180
  end
181
181
 
182
182
  # Returns a new array populated with the values from the map.
183
183
  #
184
184
  # @return [Array]
185
185
  def values
186
- map {|_key, value| value}
186
+ map { |_key, value| value }
187
187
  end
188
188
  end
189
189