erp_integration 0.53.0 → 0.53.1

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: 7719f3eaa455812be74cbdb4448118217e8294c90e742bb9d4074fad423a10ab
4
- data.tar.gz: 35e221932e9c229957951869daa324c7f40549bf1cdfe21d7c56dc3202741832
3
+ metadata.gz: 94641315e041baf5dfa5ade8f7d4802f53bf70cff09f3fadd61b2232f2b541ca
4
+ data.tar.gz: b32375c29eed88ee070426ea42465d36cb8c8dd309512a41cf54649fc956940d
5
5
  SHA512:
6
- metadata.gz: e9835ef2f7400c112999ac8ca0135d7f11be0c69129bd4403f5620042b06394e09a6ec62c225d9d82d41d66b7d6290a602edf525d48fe910e92ab48562456711
7
- data.tar.gz: 4a39d845dda9398b971334392fb58539a3cc208896a19e608c2207ddc040331b9e2a27ffef6ff1bcdc1ab56df4ba4a5de1a6da85399d37ca53a3b795f762771f
6
+ metadata.gz: 4e87ddefd4bc53228dd37ba8f6e1651d9f160401898f44f9d16b740b3e78d5aab6f1e2cc415b6ab31066393e7ac8babf272c17107bc7b113005f67ec5c8395c2
7
+ data.tar.gz: 9c0f725849676df52f149df431367079cb9652afcb07ad55b295433e96124f251a292e91f98df08d70f9fe986b1da25b1a8e497d6ccfddb2a04bd8529fd801b4
@@ -72,16 +72,19 @@ module ErpIntegration
72
72
  # be executed and the results will be fetched.
73
73
  # @return [Array] An enumerable collection object with all API results.
74
74
  def all
75
- client.put(
76
- api_resource_path,
77
- Query.new(
78
- fields: selected_fields,
79
- filters: where_clauses,
80
- alternative_filters: or_clauses,
81
- limit: limit_value,
82
- offset: calculated_offset
83
- )
84
- ).map { |item| resource_klass.new(item) }
75
+ return @results if defined?(@results)
76
+
77
+ @results =
78
+ client.put(
79
+ api_resource_path,
80
+ Query.new(
81
+ fields: selected_fields,
82
+ filters: where_clauses,
83
+ alternative_filters: or_clauses,
84
+ limit: limit_value,
85
+ offset: calculated_offset
86
+ )
87
+ ).map { |item| resource_klass.new(item) }
85
88
  end
86
89
 
87
90
  # As with the `all` method, the `query methods` lazyly build a search/read
@@ -90,14 +93,17 @@ module ErpIntegration
90
93
  # the result will be fetched
91
94
  # @return [Integer] The count of records that match with the query in Fulfil
92
95
  def count
93
- client.put(
94
- "model/#{model_name}/search_count",
95
- Query.new(
96
- fields: nil,
97
- filters: where_clauses,
98
- alternative_filters: or_clauses
99
- ).to_h.except(:fields)
100
- )
96
+ return @count if defined?(@count)
97
+
98
+ @count =
99
+ client.put(
100
+ "model/#{model_name}/search_count",
101
+ Query.new(
102
+ fields: nil,
103
+ filters: where_clauses,
104
+ alternative_filters: or_clauses
105
+ ).to_h.except(:fields)
106
+ )
101
107
  end
102
108
 
103
109
  # The `each` method turns the `ApiResource` instance into an enumerable object.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ErpIntegration
4
- VERSION = '0.53.0'
4
+ VERSION = '0.53.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erp_integration
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.53.0
4
+ version: 0.53.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Vermaas