erp_integration 0.32.0 → 0.33.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
  SHA256:
3
- metadata.gz: 68d6ab5f0b8acef6529a34e21cd851993017341ad68c7c1fb1dfb1ccd2762edd
4
- data.tar.gz: b2ee68b1369e4cc4eee5bb479cae9f12eee26f0d892db7a4b1e93e7fa7c3c31c
3
+ metadata.gz: 3ac97590f290e26055da9668b54eda483dd7aa197d2c131ed129898af7722818
4
+ data.tar.gz: f2b35c2a82dc71e4fb520dcbc119b0ed2c0668157620c190002452956c381a12
5
5
  SHA512:
6
- metadata.gz: 0b1b421b5dd434a0a5607a78ffc5935a65c5f6c867bd964547689cf1a90fcccfb991aad1fcc04d36090bdbc32ac8b9da6ba25efee8264dc7e83f13c5bf5c70ca
7
- data.tar.gz: 329629ed3de09845cd3c9eeb1114f3ca96d245bea2970f423e5e74efe501ca2b1d2bfe48044ad97ed652a254bc561e2f66193a7c59193913d64379f10f3e6b85
6
+ metadata.gz: 7b271c8b16571c28015c5ce11387831a1ab434953e32106396dbb324e9a9b08d82aacfc270637a81db51de40bae78ceff1430ba85e4fd63c8275ab108ca856a2
7
+ data.tar.gz: 9f513bc64319f18136f5f0e11aefe6a7b69e83deb0023af6227bb299f5324231369eb2ba655bd4940b2dbeae623f1c5ff205f978a3dd477cea46ed22e1a9c0ee
@@ -100,6 +100,35 @@ module ErpIntegration
100
100
  all.each(&block)
101
101
  end
102
102
 
103
+ # Iterates over each page of results and yields it for processing.
104
+ #
105
+ # It fetches each page of results and yields it to the provided block for
106
+ # processing. The loop continues until there are no more results to process.
107
+ #
108
+ # @example
109
+ # ErpIntegration::SalesOrder.select(:id, :total_amount, :state).find_each do |orders|
110
+ # orders.each do |order|
111
+ # puts "#{order.id},$#{order.total_amount['decimal']},#{order.state}"
112
+ # end
113
+ # end
114
+ #
115
+ # => 5887403,$478.12,draft
116
+ # => 5884252,$1497.03,draft
117
+ # ...
118
+ # => 5742565,$78.75,draft
119
+ #
120
+ # @yield [results] Yields the current page of results to the provided block
121
+ # for processing.
122
+ # @yieldparam results [Array] An array of results for the current page.
123
+ # @return [nil]
124
+ def find_each
125
+ page = 1
126
+ while (results = clone.page(page)).any?
127
+ yield results
128
+ page += 1
129
+ end
130
+ end
131
+
103
132
  private
104
133
 
105
134
  # Builds the relative resource path and adds the context if needed.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErpIntegration
4
- VERSION = '0.32.0'
4
+ VERSION = '0.33.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erp_integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.32.0
4
+ version: 0.33.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Vermaas
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-05 00:00:00.000000000 Z
11
+ date: 2023-05-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -224,7 +224,7 @@ dependencies:
224
224
  - - '='
225
225
  - !ruby/object:Gem::Version
226
226
  version: 1.19.2
227
- description:
227
+ description:
228
228
  email:
229
229
  - stefan@knowndecimal.com
230
230
  executables: []
@@ -330,7 +330,7 @@ metadata:
330
330
  homepage_uri: https://www.github.com/mejuri-inc/erp-integration
331
331
  source_code_uri: https://www.github.com/mejuri-inc/erp-integration
332
332
  changelog_uri: https://www.github.com/mejuri-inc/erp-integration/blob/main/CHANGELOG.md
333
- post_install_message:
333
+ post_install_message:
334
334
  rdoc_options: []
335
335
  require_paths:
336
336
  - lib
@@ -345,8 +345,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
345
345
  - !ruby/object:Gem::Version
346
346
  version: '0'
347
347
  requirements: []
348
- rubygems_version: 3.2.22
349
- signing_key:
348
+ rubygems_version: 3.3.7
349
+ signing_key:
350
350
  specification_version: 4
351
351
  summary: Connects Mejuri with third-party ERP vendors
352
352
  test_files: []