ehbrs_ruby_utils 0.51.1 → 0.52.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d25c7ea513dfe3f38866c73e9de18fb6793dda8f9937c295b5732ceda50661b
4
- data.tar.gz: c3dda1034ece0d7beded26fb17a81169e37f0d48dc159bf1f90bfad2a4995a74
3
+ metadata.gz: 39ae074b510ee89ed1ffd45a0595190a90738f93582a01f4ca2424f66f2c2411
4
+ data.tar.gz: 0c7e26edf028c6eabc153acd7e902f12696b00223f7258cd5758ffa530900d91
5
5
  SHA512:
6
- metadata.gz: d221454359c3f2869d0e7c0272276087cfe09140bb8b54a16437c9d0e229aec92dd27e31419739bbb15456ea20ea7110f1a6bca8b1c7267eaa1cff2ed2da56fc
7
- data.tar.gz: ba4a0901a5b41e428b35acb664ffc0a5ca84019e521ce2860e46ee8ee1a4c47ef85f5e864818826b095b1f47661a3cfb79a370cd735ca7482d96f36e26b4781d
6
+ metadata.gz: a57049127567616a8d41a45912f3c4f168595a7d3eaf487a88407437b888709dafb927831173eeae8bc93de57944e8384ee9d3c95cdea9eeef2c2056ca7c631a
7
+ data.tar.gz: 4e95c78d5ff0cc4d43fd6c0f65cbe1617ceca831783e01b9634190b38043f4871bf86273f47798d1dd6900e2da7d1b50eaebae1752852d0d9d01bbefc9e2eaf9
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EhbrsRubyUtils
4
- VERSION = '0.51.1'
4
+ VERSION = '0.52.0'
5
5
  end
@@ -5,7 +5,7 @@ module EhbrsRubyUtils
5
5
  class Instance < ::Avm::EacRailsBase0::Instances::Base
6
6
  class HttpRequest
7
7
  enable_method_class
8
- enable_simple_cache
8
+ enable_memoized
9
9
  common_constructor :instance, :resource_url_suffix, :source_options, default: [{}]
10
10
 
11
11
  # @return [EacRest::Response]
@@ -17,20 +17,22 @@ module EhbrsRubyUtils
17
17
 
18
18
  private
19
19
 
20
- # @return [::Struct.new(:verb, :body_data, :headers)]
21
- def options_uncached
20
+ # @return [::Struct.new(:verb, :body_data, :headers, :timeout)]
21
+ memoize def options
22
22
  options = source_options.to_options_consumer
23
23
  verb = options.consume(:method, :get).to_sym
24
24
  body_data = options.consume(:body)
25
25
  headers = options.consume(:header)
26
+ timeout = options.consume(:timeout)
26
27
  options.validate
27
- ::Struct.new(:verb, :body_data, :headers).new(verb, body_data, headers)
28
+ ::Struct.new(:verb, :body_data, :headers, :timeout)
29
+ .new(verb, body_data, headers, timeout)
28
30
  end
29
31
 
30
32
  # @return [EacRest::Request]
31
33
  def request
32
- instance.api.request(resource_url_suffix).verb(options.verb).headers(options.headers)
33
- .body_data(options.body_data)
34
+ %i[verb headers body_data timeout]
35
+ .inject(instance.api.request(resource_url_suffix)) { |a, e| a.send(e, options.send(e)) }
34
36
  end
35
37
  end
36
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ehbrs_ruby_utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.51.1
4
+ version: 0.52.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eduardo H. Bogoni