erp_integration 0.19.0 → 0.20.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: 07ca72811d7f1eb2659d9161890f3a43ce8b773e9637e55dea2e7c0f5b6d8d44
4
- data.tar.gz: 7ab55ad7cf24cbbf761e344f5a8a4a91fca2110637f28112d47ce49a0b11e639
3
+ metadata.gz: cc78fc9da96c988f29c92bf41501a8827626453e66fdd806f51e16a9f1b8e1bc
4
+ data.tar.gz: 7f0d3551bdb15ae06fbe67c96ff2d257f14a61eddc3cbe56d554643ec767e6ae
5
5
  SHA512:
6
- metadata.gz: cb0053f0c8d31c3e3fd003aa9c65e141be176f4f60c787a132ffd3dc16300ecdca01be39e2b2c4e7897f5120464957979ab052139e4a381033e5f1467860bedd
7
- data.tar.gz: 9987a496c6ee7bbd02f5faa92f3fb93172544ee999444d9f2851bbc30cbb59b3fe1ca10b424187f27e553eb0fd947ebe6118190546e167679c0166e4f840f9e5
6
+ metadata.gz: 642e6917b8580bece6dc22acde22db86f91060419a059eda273861c2c6bf02928220128e4123249533024cf9b88a3d9455208065b538dc82a3a3080ccebd7f69
7
+ data.tar.gz: 0f542badd49a4615043e4b237d48606d18c354091fe564d74a92a005846e22338c76b1abff03be6ac99c26f358d78f46ce205dec44c2cb8c02ddcccd5769f864
@@ -69,8 +69,8 @@ module ErpIntegration
69
69
  fields: selected_fields,
70
70
  filters: where_clauses,
71
71
  alternative_filters: or_clauses,
72
- offset: offset_clause,
73
- limit: limit_clause
72
+ offset: offset_value,
73
+ limit: limit_value
74
74
  )
75
75
  ).map { |item| resource_klass.new(item) }
76
76
  end
@@ -6,27 +6,36 @@ module ErpIntegration
6
6
  DEFAULT_OFFSET = 0
7
7
  MAX_LIMIT = 500 # Max limit set by FF
8
8
 
9
- attr_accessor :offset_clause, :limit_clause
9
+ attr_accessor :offset_value, :limit_value
10
10
 
11
- # Fulfil by default is returning us the first 500 records on every query that we made.
12
- # The `offset` method, as the name sais, will allow us to move the offset of the results.
13
- # @example
14
- # $ ErpIntegration::SalesOrder.offset(10).all
15
- # # => <ErpIntegration::Fulfil::Collection @items=[<ErpIntegration::SalesOrder @offset=10 />] />
16
- def offset(offset)
17
- self.offset_clause = offset
11
+ # The {#offset} method allows navigating through the returned resources from
12
+ # Fulfil's API endpoints just as with a regular database.
13
+ #
14
+ # @param value [Integer] The offset for the number of resources.
15
+ # @return [ErpIntegration::Fulfil::ApiResource]
16
+ def offset(value)
17
+ clone.offset!(value)
18
+ end
18
19
 
20
+ def offset!(value)
21
+ self.offset_value = value
19
22
  self
20
23
  end
21
24
 
22
- # Fulfil by default is returning us the first 500 records on every query that we made.
23
- # The `limit` method will allow us to modify the amount of records that we want to receive.
24
- # @example
25
- # $ ErpIntegration::SalesOrder.limit(5).all
26
- # # => <ErpIntegration::Fulfil::Collection @items=[<ErpIntegration::SalesOrder @limit=5 />] />
27
- def limit(limit)
28
- self.limit_clause = [limit, MAX_LIMIT].min
25
+ # By default, Fulfil returns the first 500 records for every query to their
26
+ # API endpoints. With the {#limit} method, it's possible to modify the number
27
+ # of records to return.
28
+ #
29
+ # NOTE: The maximum limit is 500 per dictation of Fulfil.
30
+ #
31
+ # @param value [Integer] The number of resources to return.
32
+ # @return [ErpIntegration::Fulfil::ApiResource]
33
+ def limit(value)
34
+ clone.limit!(value)
35
+ end
29
36
 
37
+ def limit!(value)
38
+ self.limit_value = [value, MAX_LIMIT].min
30
39
  self
31
40
  end
32
41
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErpIntegration
4
- VERSION = '0.19.0'
4
+ VERSION = '0.20.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.19.0
4
+ version: 0.20.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-01-24 00:00:00.000000000 Z
11
+ date: 2023-01-27 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: []
@@ -321,7 +321,7 @@ metadata:
321
321
  homepage_uri: https://www.github.com/mejuri-inc/erp-integration
322
322
  source_code_uri: https://www.github.com/mejuri-inc/erp-integration
323
323
  changelog_uri: https://www.github.com/mejuri-inc/erp-integration/blob/main/CHANGELOG.md
324
- post_install_message:
324
+ post_install_message:
325
325
  rdoc_options: []
326
326
  require_paths:
327
327
  - lib
@@ -336,9 +336,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
336
336
  - !ruby/object:Gem::Version
337
337
  version: '0'
338
338
  requirements: []
339
- rubyforge_project:
340
- rubygems_version: 2.7.11
341
- signing_key:
339
+ rubygems_version: 3.3.7
340
+ signing_key:
342
341
  specification_version: 4
343
342
  summary: Connects Mejuri with third-party ERP vendors
344
343
  test_files: []