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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 39ae074b510ee89ed1ffd45a0595190a90738f93582a01f4ca2424f66f2c2411
|
|
4
|
+
data.tar.gz: 0c7e26edf028c6eabc153acd7e902f12696b00223f7258cd5758ffa530900d91
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a57049127567616a8d41a45912f3c4f168595a7d3eaf487a88407437b888709dafb927831173eeae8bc93de57944e8384ee9d3c95cdea9eeef2c2056ca7c631a
|
|
7
|
+
data.tar.gz: 4e95c78d5ff0cc4d43fd6c0f65cbe1617ceca831783e01b9634190b38043f4871bf86273f47798d1dd6900e2da7d1b50eaebae1752852d0d9d01bbefc9e2eaf9
|
|
@@ -5,7 +5,7 @@ module EhbrsRubyUtils
|
|
|
5
5
|
class Instance < ::Avm::EacRailsBase0::Instances::Base
|
|
6
6
|
class HttpRequest
|
|
7
7
|
enable_method_class
|
|
8
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
33
|
-
.
|
|
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
|