google-cloud-datastore 1.8.1 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +4 -2
  3. data/CHANGELOG.md +47 -0
  4. data/CONTRIBUTING.md +3 -3
  5. data/LOGGING.md +1 -1
  6. data/OVERVIEW.md +1 -1
  7. data/TROUBLESHOOTING.md +2 -8
  8. data/lib/google-cloud-datastore.rb +13 -18
  9. data/lib/google/cloud/datastore.rb +12 -11
  10. data/lib/google/cloud/datastore/commit.rb +4 -4
  11. data/lib/google/cloud/datastore/convert.rb +4 -4
  12. data/lib/google/cloud/datastore/credentials.rb +2 -2
  13. data/lib/google/cloud/datastore/dataset.rb +3 -3
  14. data/lib/google/cloud/datastore/dataset/lookup_results.rb +5 -5
  15. data/lib/google/cloud/datastore/dataset/query_results.rb +6 -6
  16. data/lib/google/cloud/datastore/entity.rb +4 -4
  17. data/lib/google/cloud/datastore/gql_query.rb +19 -23
  18. data/lib/google/cloud/datastore/key.rb +9 -8
  19. data/lib/google/cloud/datastore/properties.rb +1 -1
  20. data/lib/google/cloud/datastore/query.rb +15 -14
  21. data/lib/google/cloud/datastore/service.rb +34 -86
  22. data/lib/google/cloud/datastore/transaction.rb +1 -1
  23. data/lib/google/cloud/datastore/version.rb +1 -1
  24. metadata +11 -66
  25. data/lib/google/cloud/datastore/v1.rb +0 -16
  26. data/lib/google/cloud/datastore/v1/credentials.rb +0 -39
  27. data/lib/google/cloud/datastore/v1/datastore_client.rb +0 -577
  28. data/lib/google/cloud/datastore/v1/datastore_client_config.json +0 -61
  29. data/lib/google/cloud/datastore/v1/doc/google/datastore/v1/datastore.rb +0 -283
  30. data/lib/google/cloud/datastore/v1/doc/google/datastore/v1/entity.rb +0 -189
  31. data/lib/google/cloud/datastore/v1/doc/google/datastore/v1/query.rb +0 -297
  32. data/lib/google/cloud/datastore/v1/doc/google/protobuf/struct.rb +0 -74
  33. data/lib/google/cloud/datastore/v1/doc/google/protobuf/timestamp.rb +0 -109
  34. data/lib/google/cloud/datastore/v1/doc/google/protobuf/wrappers.rb +0 -26
  35. data/lib/google/cloud/datastore/v1/doc/google/type/latlng.rb +0 -65
  36. data/lib/google/datastore/v1/datastore_pb.rb +0 -147
  37. data/lib/google/datastore/v1/datastore_services_pb.rb +0 -65
  38. data/lib/google/datastore/v1/entity_pb.rb +0 -64
  39. data/lib/google/datastore/v1/query_pb.rb +0 -132
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 905f1055fbaea77d81cb9152e3eebb63b3777ae5193835a3e44340d7bb61ff40
4
- data.tar.gz: bba3960ee3e69c7979a8e6330a132e640ac36f10835b5d6051ea8e979841ac14
3
+ metadata.gz: 02bfd91dd941f3ae7462fb7a4298568acce9b3b4b2f4e157ae7ff80e6b312b9d
4
+ data.tar.gz: 968e1bef52b2102f7f946bc19543882aa71d192dff44d43ac530c1d2a90a9a8f
5
5
  SHA512:
6
- metadata.gz: 1d454255b9931772a99d01c5b7cd08fee32a6e072dab9165a1d9260cf68cb5975fe14c5e12170fe96e9d5c9a457ff5eab8f850313537eda57186fc6b4b1387ed
7
- data.tar.gz: 7463bfc195adba4136e61ba7157684515351f7a42c92c41c2266c60c6251a73a5f019898b2c7b6b359d84cbdac05ed39df7aa000fbae8a3d3b584b6e998efdf4
6
+ metadata.gz: 901c1e1ea9f306588e06a58e9f1a4abe549173b790d17f175a7b4b82eee5080a4d9202c4f426c141dfec24479d3cc8da83175bbba7ac4430b3ff7c36fd466494
7
+ data.tar.gz: 128ea0ee6c5cecddbcd0555cdb648b85dcb001d419ad53775283d483b16a584ae91c46771271ec6d5fbdd3a8d99717c4eb70336e317efd1d3405758fafe07381
data/AUTHENTICATION.md CHANGED
@@ -76,7 +76,8 @@ The environment variables that google-cloud-datastore checks for project ID are:
76
76
  1. `DATASTORE_PROJECT`
77
77
  2. `GOOGLE_CLOUD_PROJECT`
78
78
 
79
- The environment variables that google-cloud-datastore checks for credentials are configured on {Google::Cloud::Datastore::V1::Credentials}:
79
+ The environment variables that google-cloud-datastore checks for credentials are configured on
80
+ {Google::Cloud::Datastore::Credentials}:
80
81
 
81
82
  1. `DATASTORE_CREDENTIALS` - Path to JSON file, or JSON contents
82
83
  2. `DATASTORE_KEYFILE` - Path to JSON file, or JSON contents
@@ -95,7 +96,8 @@ client = Google::Cloud::Datastore.new
95
96
 
96
97
  ### Configuration
97
98
 
98
- The **Project ID** and **Credentials JSON** can be configured instead of placing them in environment variables or providing them as arguments.
99
+ The **Project ID** and the path to the **Credentials JSON** file can be configured
100
+ instead of placing them in environment variables or providing them as arguments.
99
101
 
100
102
  ```ruby
101
103
  require "google/cloud/datastore"
data/CHANGELOG.md CHANGED
@@ -1,5 +1,52 @@
1
1
  # Release History
2
2
 
3
+ ### 2.2.1 / 2021-07-08
4
+
5
+ #### Documentation
6
+
7
+ * Update AUTHENTICATION.md in handwritten packages
8
+
9
+ ### 2.2.0 / 2021-03-10
10
+
11
+ #### Features
12
+
13
+ * Drop support for Ruby 2.4 and add support for Ruby 3.0
14
+
15
+ ### 2.1.0 / 2020-09-17
16
+
17
+ #### Features
18
+
19
+ * quota_project can be set via library configuration ([#7630](https://www.github.com/googleapis/google-cloud-ruby/issues/7630))
20
+
21
+ ### 2.0.0 / 2020-08-06
22
+
23
+ This is a major update that removes the "low-level" client interface code, and
24
+ instead adds the new `google-cloud-datastore-v1` gem as a dependency.
25
+ The new dependency is a rewritten low-level client, produced by a next-
26
+ generation client code generator, with improved performance and stability.
27
+
28
+ This change should have no effect on the high-level interface that most users
29
+ will use. The one exception is that the (mostly undocumented) `client_config`
30
+ argument, for adjusting low-level parameters such as RPC retry settings on
31
+ client objects, has been removed. If you need to adjust these parameters, use
32
+ the configuration interface in `google-cloud-datastore-v1`.
33
+
34
+ Substantial changes have been made in the low-level interfaces, however. If you
35
+ are using the low-level classes under the `Google::Cloud::Datastore::V1` module,
36
+ please review the docs for the new `google-cloud-datastore-v1` gem. In
37
+ particular:
38
+
39
+ * Some classes have been renamed, notably the client class itself.
40
+ * The client constructor takes a configuration block instead of configuration
41
+ keyword arguments.
42
+ * All RPC method arguments are now keyword arguments.
43
+
44
+ ### 1.8.2 / 2020-05-28
45
+
46
+ #### Documentation
47
+
48
+ * Fix a few broken links
49
+
3
50
  ### 1.8.1 / 2020-05-19
4
51
 
5
52
  #### Bug Fixes
data/CONTRIBUTING.md CHANGED
@@ -24,7 +24,7 @@ be able to accept your pull requests.
24
24
  In order to use the google-cloud-datastore console and run the project's tests,
25
25
  there is a small amount of setup:
26
26
 
27
- 1. Install Ruby. google-cloud-datastore requires Ruby 2.4+. You may choose to
27
+ 1. Install Ruby. google-cloud-datastore requires Ruby 2.5+. You may choose to
28
28
  manage your Ruby and gem installations with [RVM](https://rvm.io/),
29
29
  [rbenv](https://github.com/rbenv/rbenv), or
30
30
  [chruby](https://github.com/postmodern/chruby).
@@ -45,7 +45,7 @@ there is a small amount of setup:
45
45
 
46
46
  ```sh
47
47
  $ cd google-cloud-datastore/
48
- $ bundle exec rake bundleupdate
48
+ $ bundle install
49
49
  ```
50
50
 
51
51
  ## Console
@@ -119,7 +119,7 @@ If you alter an example's title, you may encounter breaking tests.
119
119
  ### Datastore Acceptance Tests
120
120
 
121
121
  The Datastore acceptance tests interact with the live service API. Follow the
122
- instructions in the {file:AUTHENTICATION.md Authentication guide} for enabling
122
+ instructions in the {file:AUTHENTICATION.md Authentication Guide} for enabling
123
123
  the Datastore API. Occasionally, some API features may not yet be generally
124
124
  available, making it difficult for some contributors to successfully run the
125
125
  entire acceptance test suite. However, please ensure that you do successfully
data/LOGGING.md CHANGED
@@ -3,7 +3,7 @@
3
3
  To enable logging for this library, set the logger for the underlying
4
4
  [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library. The logger
5
5
  that you set may be a Ruby stdlib
6
- [`Logger`](https://ruby-doc.org/stdlib-2.5.0/libdoc/logger/rdoc/Logger.html) as
6
+ [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as
7
7
  shown below, or a
8
8
  [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
9
9
  that will write logs to [Stackdriver
data/OVERVIEW.md CHANGED
@@ -490,5 +490,5 @@ datastore = Google::Cloud::Datastore.new timeout: 120
490
490
  ## Additional information
491
491
 
492
492
  Google Cloud Datastore can be configured to use an emulator or to enable gRPC's
493
- logging. To learn more, see the {file:EMULATOR.md Emulator guide} and
493
+ logging. To learn more, see the {file:EMULATOR.md Emulator guide}} and
494
494
  {file:LOGGING.md Logging guide}.
data/TROUBLESHOOTING.md CHANGED
@@ -24,14 +24,8 @@ improved, *please* create a new issue on GitHub so we can talk about it.
24
24
 
25
25
  - [New issue][gh-ruby]
26
26
 
27
- Or, you can ask questions on the [Google Cloud Platform Slack][slack-ruby]. You
28
- can use the "ruby" channel for general Ruby questions, or use the
29
- "google-cloud-ruby" channel if you have questions about this gem in particular.
30
-
31
27
  [so-ruby]: http://stackoverflow.com/questions/tagged/google-cloud-platform+ruby+datastore
32
28
 
33
- [gh-search-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues?q=label%3A%22api%3A+datastore%22
34
-
35
- [gh-ruby]: https://github.com/googlecloudplatform/google-cloud-ruby/issues/new
29
+ [gh-search-ruby]: https://github.com/googleapis/google-cloud-ruby/issues?q=label%3A%22api%3A+datastore%22
36
30
 
37
- [slack-ruby]: https://gcp-slack.appspot.com/
31
+ [gh-ruby]: https://github.com/googleapis/google-cloud-ruby/issues/new
@@ -42,8 +42,6 @@ module Google
42
42
  #
43
43
  # * `https://www.googleapis.com/auth/datastore`
44
44
  # @param [Integer] timeout Default timeout to use in requests. Optional.
45
- # @param [Hash] client_config A hash of values to override the default
46
- # behavior of the API client. See Google::Gax::CallSettings. Optional.
47
45
  #
48
46
  # @return [Google::Cloud::Datastore::Dataset]
49
47
  #
@@ -69,10 +67,9 @@ module Google
69
67
  # platform_scope = "https://www.googleapis.com/auth/cloud-platform"
70
68
  # datastore = gcloud.datastore scope: platform_scope
71
69
  #
72
- def datastore scope: nil, timeout: nil, client_config: nil
70
+ def datastore scope: nil, timeout: nil
73
71
  Google::Cloud.datastore @project, @keyfile,
74
- scope: scope, timeout: (timeout || @timeout),
75
- client_config: client_config
72
+ scope: scope, timeout: (timeout || @timeout)
76
73
  end
77
74
 
78
75
  ##
@@ -96,8 +93,6 @@ module Google
96
93
  #
97
94
  # * `https://www.googleapis.com/auth/datastore`
98
95
  # @param [Integer] timeout Default timeout to use in requests. Optional.
99
- # @param [Hash] client_config A hash of values to override the default
100
- # behavior of the API client. See Google::Gax::CallSettings. Optional.
101
96
  #
102
97
  # @return [Google::Cloud::Datastore::Dataset]
103
98
  #
@@ -117,12 +112,11 @@ module Google
117
112
  # datastore.save task
118
113
  #
119
114
  def self.datastore project_id = nil, credentials = nil, scope: nil,
120
- timeout: nil, client_config: nil
115
+ timeout: nil
121
116
  require "google/cloud/datastore"
122
117
  Google::Cloud::Datastore.new project_id: project_id,
123
118
  credentials: credentials,
124
- scope: scope, timeout: timeout,
125
- client_config: client_config
119
+ scope: scope, timeout: timeout
126
120
  end
127
121
  end
128
122
  end
@@ -141,17 +135,18 @@ Google::Cloud.configure.add_config! :datastore do |config|
141
135
  default_emulator = Google::Cloud::Config.deferred do
142
136
  ENV["DATASTORE_EMULATOR_HOST"]
143
137
  end
138
+ default_scopes = [
139
+ "https://www.googleapis.com/auth/cloud-platform",
140
+ "https://www.googleapis.com/auth/datastore"
141
+ ]
144
142
 
145
143
  config.add_field! :project_id, default_project, match: String, allow_nil: true
146
144
  config.add_alias! :project, :project_id
147
- config.add_field! :credentials, default_creds,
148
- match: [String, Hash, Google::Auth::Credentials],
149
- allow_nil: true
145
+ config.add_field! :credentials, default_creds, match: [String, Hash, Google::Auth::Credentials], allow_nil: true
150
146
  config.add_alias! :keyfile, :credentials
151
- config.add_field! :scope, nil, match: [String, Array]
147
+ config.add_field! :scope, default_scopes, match: [String, Array]
148
+ config.add_field! :quota_project, nil, match: String
152
149
  config.add_field! :timeout, nil, match: Integer
153
- config.add_field! :client_config, nil, match: Hash
154
- config.add_field! :emulator_host, default_emulator,
155
- match: String, allow_nil: true
156
- config.add_field! :endpoint, nil, match: String
150
+ config.add_field! :emulator_host, default_emulator, match: String, allow_nil: true
151
+ config.add_field! :endpoint, "datastore.googleapis.com", match: String
157
152
  end
@@ -70,8 +70,6 @@ module Google
70
70
  #
71
71
  # * `https://www.googleapis.com/auth/datastore`
72
72
  # @param [Integer] timeout Default timeout to use in requests. Optional.
73
- # @param [Hash] client_config A hash of values to override the default
74
- # behavior of the API client. See Google::Gax::CallSettings. Optional.
75
73
  # @param [String] endpoint Override of the endpoint host name. Optional.
76
74
  # If the param is nil, uses the default endpoint.
77
75
  # @param [String] emulator_host Datastore emulator host. Optional.
@@ -99,13 +97,17 @@ module Google
99
97
  #
100
98
  # datastore.save task
101
99
  #
102
- def self.new project_id: nil, credentials: nil, scope: nil, timeout: nil,
103
- client_config: nil, endpoint: nil, emulator_host: nil,
104
- project: nil, keyfile: nil
100
+ def self.new project_id: nil,
101
+ credentials: nil,
102
+ scope: nil,
103
+ timeout: nil,
104
+ endpoint: nil,
105
+ emulator_host: nil,
106
+ project: nil,
107
+ keyfile: nil
105
108
  project_id ||= (project || default_project_id)
106
109
  scope ||= configure.scope
107
110
  timeout ||= configure.timeout
108
- client_config ||= configure.client_config
109
111
  endpoint ||= configure.endpoint
110
112
  emulator_host ||= configure.emulator_host
111
113
 
@@ -116,8 +118,7 @@ module Google
116
118
  return Datastore::Dataset.new(
117
119
  Datastore::Service.new(
118
120
  project_id, :this_channel_is_insecure,
119
- host: emulator_host, timeout: timeout,
120
- client_config: client_config
121
+ host: emulator_host, timeout: timeout
121
122
  )
122
123
  )
123
124
  end
@@ -136,7 +137,7 @@ module Google
136
137
  Datastore::Dataset.new(
137
138
  Datastore::Service.new(
138
139
  project_id, credentials,
139
- host: endpoint, timeout: timeout, client_config: client_config
140
+ host: endpoint, timeout: timeout
140
141
  )
141
142
  )
142
143
  end
@@ -158,8 +159,6 @@ module Google
158
159
  # * `scope` - (String, Array<String>) The OAuth 2.0 scopes controlling
159
160
  # the set of resources and operations that the connection can access.
160
161
  # * `timeout` - (Integer) Default timeout to use in requests.
161
- # * `client_config` - (Hash) A hash of values to override the default
162
- # behavior of the API client.
163
162
  # * `endpoint` - (String) Override of the endpoint host name, or `nil`
164
163
  # to use the default endpoint.
165
164
  # * `emulator_host` - (String) Host name of the emulator. Defaults to
@@ -191,4 +190,6 @@ module Google
191
190
  end
192
191
  end
193
192
  end
193
+ ## Legacy generated client namespace
194
+ Datastore = Cloud::Datastore unless const_defined? :Datastore
194
195
  end
@@ -136,16 +136,16 @@ module Google
136
136
  def mutations
137
137
  mutations = []
138
138
  mutations += @shared_upserts.map do |entity|
139
- Google::Datastore::V1::Mutation.new upsert: entity.to_grpc
139
+ Google::Cloud::Datastore::V1::Mutation.new upsert: entity.to_grpc
140
140
  end
141
141
  mutations += @shared_inserts.map do |entity|
142
- Google::Datastore::V1::Mutation.new insert: entity.to_grpc
142
+ Google::Cloud::Datastore::V1::Mutation.new insert: entity.to_grpc
143
143
  end
144
144
  mutations += @shared_updates.map do |entity|
145
- Google::Datastore::V1::Mutation.new update: entity.to_grpc
145
+ Google::Cloud::Datastore::V1::Mutation.new update: entity.to_grpc
146
146
  end
147
147
  mutations += @shared_deletes.map do |key|
148
- Google::Datastore::V1::Mutation.new delete: key.to_grpc
148
+ Google::Cloud::Datastore::V1::Mutation.new delete: key.to_grpc
149
149
  end
150
150
  mutations
151
151
  end
@@ -77,7 +77,7 @@ module Google
77
77
  end
78
78
 
79
79
  ##
80
- # Gets an object from a Google::Datastore::V1::Value.
80
+ # Gets an object from a Google::Cloud::Datastore::V1::Value.
81
81
  def self.from_value grpc_value
82
82
  if grpc_value.value_type == :null_value
83
83
  return nil
@@ -110,9 +110,9 @@ module Google
110
110
  end
111
111
 
112
112
  ##
113
- # Stores an object into a Google::Datastore::V1::Value.
113
+ # Stores an object into a Google::Cloud::Datastore::V1::Value.
114
114
  def self.to_value value
115
- v = Google::Datastore::V1::Value.new
115
+ v = Google::Cloud::Datastore::V1::Value.new
116
116
  if NilClass === value
117
117
  v.null_value = :NULL_VALUE
118
118
  elsif TrueClass === value
@@ -133,7 +133,7 @@ module Google
133
133
  elsif String === value
134
134
  v.string_value = value
135
135
  elsif Array === value
136
- v.array_value = Google::Datastore::V1::ArrayValue.new(
136
+ v.array_value = Google::Cloud::Datastore::V1::ArrayValue.new(
137
137
  values: value.map { |val| to_value val }
138
138
  )
139
139
  elsif value.respond_to? :to_time
@@ -14,7 +14,7 @@
14
14
 
15
15
 
16
16
  require "googleauth"
17
- require "google/cloud/datastore/v1/credentials"
17
+ require "google/cloud/datastore/v1/datastore/credentials"
18
18
 
19
19
  module Google
20
20
  module Cloud
@@ -38,7 +38,7 @@ module Google
38
38
  #
39
39
  # datastore.project_id #=> "my-todo-project"
40
40
  #
41
- class Credentials < Google::Cloud::Datastore::V1::Credentials
41
+ class Credentials < Google::Cloud::Datastore::V1::Datastore::Credentials
42
42
  end
43
43
  end
44
44
  end
@@ -535,9 +535,9 @@ module Google
535
535
  begin
536
536
  yield tx
537
537
  tx.commit
538
- rescue Google::Cloud::UnavailableError => err
538
+ rescue Google::Cloud::UnavailableError => e
539
539
  # Re-raise if deadline has passed
540
- raise err if Time.now - start_time > deadline
540
+ raise e if Time.now - start_time > deadline
541
541
 
542
542
  # Sleep with incremental backoff
543
543
  sleep backoff *= 1.3
@@ -878,7 +878,7 @@ module Google
878
878
 
879
879
  def validate_deadline deadline
880
880
  return 60 unless deadline.is_a? Numeric
881
- return 60 if deadline < 0
881
+ return 60 if deadline.negative?
882
882
  deadline
883
883
  end
884
884
 
@@ -167,17 +167,17 @@ module Google
167
167
  # puts "Task #{t.key.id} (#cursor)"
168
168
  # end
169
169
  #
170
- def all request_limit: nil
170
+ def all request_limit: nil, &block
171
171
  request_limit = request_limit.to_i if request_limit
172
172
  unless block_given?
173
173
  return enum_for :all, request_limit: request_limit
174
174
  end
175
175
  results = self
176
176
  loop do
177
- results.each { |r| yield r }
177
+ results.each(&block)
178
178
  if request_limit
179
179
  request_limit -= 1
180
- break if request_limit < 0
180
+ break if request_limit.negative?
181
181
  end
182
182
  break unless results.next?
183
183
  results = results.next
@@ -187,14 +187,14 @@ module Google
187
187
  ##
188
188
  # @private New Dataset::LookupResults from a
189
189
  # Google::Dataset::V1::LookupResponse object.
190
- def self.from_grpc lookup_res, service, consistency = nil, tx = nil
190
+ def self.from_grpc lookup_res, service, consistency = nil, transaction = nil
191
191
  entities = to_gcloud_entities lookup_res.found
192
192
  deferred = to_gcloud_keys lookup_res.deferred
193
193
  missing = to_gcloud_entities lookup_res.missing
194
194
  new(entities).tap do |lr|
195
195
  lr.instance_variable_set :@service, service
196
196
  lr.instance_variable_set :@consistency, consistency
197
- lr.instance_variable_set :@transaction, tx
197
+ lr.instance_variable_set :@transaction, transaction
198
198
  lr.instance_variable_set :@deferred, deferred
199
199
  lr.instance_variable_set :@missing, missing
200
200
  end
@@ -266,17 +266,17 @@ module Google
266
266
  # puts "Task #{t.key.id} (#cursor)"
267
267
  # end
268
268
  #
269
- def all request_limit: nil
269
+ def all request_limit: nil, &block
270
270
  request_limit = request_limit.to_i if request_limit
271
271
  unless block_given?
272
272
  return enum_for :all, request_limit: request_limit
273
273
  end
274
274
  results = self
275
275
  loop do
276
- results.each { |r| yield r }
276
+ results.each(&block)
277
277
  if request_limit
278
278
  request_limit -= 1
279
- break if request_limit < 0
279
+ break if request_limit.negative?
280
280
  end
281
281
  break unless results.next?
282
282
  results = results.next
@@ -335,7 +335,7 @@ module Google
335
335
  # puts "Task #{task.key.id} (#cursor)"
336
336
  # end
337
337
  #
338
- def all_with_cursor request_limit: nil
338
+ def all_with_cursor request_limit: nil, &block
339
339
  request_limit = request_limit.to_i if request_limit
340
340
  unless block_given?
341
341
  return enum_for :all_with_cursor, request_limit: request_limit
@@ -343,10 +343,10 @@ module Google
343
343
  results = self
344
344
 
345
345
  loop do
346
- results.zip(results.cursors).each { |r, c| yield r, c }
346
+ results.zip(results.cursors).each(&block)
347
347
  if request_limit
348
348
  request_limit -= 1
349
- break if request_limit < 0
349
+ break if request_limit.negative?
350
350
  end
351
351
  break unless results.next?
352
352
  results = results.next