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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70f3463d8af67697bd559cb53ced9254cc04a6b217963e56b7fe89e6ebd19e33
4
- data.tar.gz: f1670824ee49861fbc4ef6f50ae9e929552ce78687bf1105167338ddc45c5a3f
3
+ metadata.gz: 6f85e79d11e95b288b1fe48c55abe5c18771ef0e9250f6d3d0b04a2ee625d5a0
4
+ data.tar.gz: '08630fa642993044cccaa788ff61dd90f45e99162b85619284c612cfec3a9803'
5
5
  SHA512:
6
- metadata.gz: d92c768c2ad3f9b159e66c388e7875a30cfc30e624886e3020005fb7c6b65ca773be241a61c5da715970afbbccd1d41c83d34e1cfe6d44e6b994a73f4ef4a840
7
- data.tar.gz: 071c62aee5fc0c1de9261d14c63f6f56540025f65ec5dc55873bfe5e9a98a85a4c29d9138b462eb04736339b76ba32e24ffa9b52010dc54065b3d27f69a7c90c
6
+ metadata.gz: b391699f2a176d389d299f42f2bc440795e0b7cc64991979ee70747196b3d54c0104c8e2716dbfb35fed85e7c89fd00dd7561b1121f3db2499ac5a3b0e39b009
7
+ data.tar.gz: e57c951a46a4718d7d5474ae6483ea272f3708f0e4d75670ff4844529b28ead5c45d721d77442f2414ad2a0c98c15189195424959b3fa3737c47309749a32319
@@ -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
@@ -2,5 +2,5 @@
2
2
 
3
3
  module SynsbasenApi
4
4
  # The `VERSION` module specifies the version of the SynsbasenApi gem.
5
- VERSION = "1.0.1"
5
+ VERSION = "1.0.2"
6
6
  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.1
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 00:00:00.000000000 Z
12
+ date: 2023-11-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport