synsbasen_api 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/synsbasen_api/client.rb +14 -0
- data/lib/synsbasen_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f85e79d11e95b288b1fe48c55abe5c18771ef0e9250f6d3d0b04a2ee625d5a0
|
4
|
+
data.tar.gz: '08630fa642993044cccaa788ff61dd90f45e99162b85619284c612cfec3a9803'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b391699f2a176d389d299f42f2bc440795e0b7cc64991979ee70747196b3d54c0104c8e2716dbfb35fed85e7c89fd00dd7561b1121f3db2499ac5a3b0e39b009
|
7
|
+
data.tar.gz: e57c951a46a4718d7d5474ae6483ea272f3708f0e4d75670ff4844529b28ead5c45d721d77442f2414ad2a0c98c15189195424959b3fa3737c47309749a32319
|
data/lib/synsbasen_api/client.rb
CHANGED
@@ -37,6 +37,8 @@ module SynsbasenApi
|
|
37
37
|
req.body = body unless body.empty?
|
38
38
|
end
|
39
39
|
|
40
|
+
handle_after_request_callback(response)
|
41
|
+
|
40
42
|
ApiResponse.new(JSON.parse(response.body).deep_symbolize_keys)
|
41
43
|
rescue => e
|
42
44
|
rescue_and_raise_errors(e)
|
@@ -55,6 +57,8 @@ module SynsbasenApi
|
|
55
57
|
req.body = body
|
56
58
|
end
|
57
59
|
|
60
|
+
handle_after_request_callback(response)
|
61
|
+
|
58
62
|
ApiResponse.new(JSON.parse(response.body).deep_symbolize_keys)
|
59
63
|
rescue => e
|
60
64
|
rescue_and_raise_errors(e)
|
@@ -78,6 +82,16 @@ module SynsbasenApi
|
|
78
82
|
raise e
|
79
83
|
end
|
80
84
|
end
|
85
|
+
|
86
|
+
# Calls the after_request callback if configured in the SynsbasenApi.
|
87
|
+
#
|
88
|
+
# @param response [Faraday::Response] The Faraday response object.
|
89
|
+
# @return [void]
|
90
|
+
def handle_after_request_callback(response)
|
91
|
+
return unless SynsbasenApi.config[:after_request]
|
92
|
+
|
93
|
+
SynsbasenApi.config[:after_request].call(response)
|
94
|
+
end
|
81
95
|
end
|
82
96
|
end
|
83
97
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synsbasen_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmy Poulsen
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-11-
|
12
|
+
date: 2023-11-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|