fantasticstay_api 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fantasticstay_api/api.rb +3 -1
- data/lib/fantasticstay_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 738b039ce921a5d93329f37ae2591232a237d77bbfb31ce9e77405800565ea4b
|
4
|
+
data.tar.gz: 52ce2629fd1cbe2502996c08eaec1453f24fe194960f50cbd2e77a0380e190ea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8fbc83b647ba08bfaaae2b609ff3d1e23fefe48d1f55e9ff15387f103ac95c0a7e12d775115b547849b1ba526a418a66a91b1ba8ac6a8a17c7d6173c53313d2
|
7
|
+
data.tar.gz: da9ca9eb3fc3b60aa7a9f00601d21e8eac365be0aa15264410c13dec97853207addbb2ddf3cc67eb3cabf509a026a8b1b082d30ca7e2012910364d1cf27f206e
|
data/Gemfile.lock
CHANGED
@@ -82,13 +82,15 @@ module FantasticstayApi
|
|
82
82
|
client.headers['x-api-key'] = config.token
|
83
83
|
client.headers['User-Agent'] = config.user_agent
|
84
84
|
client.options.timeout = config.timeout
|
85
|
+
client.response :raise_error # raise Faraday::Error on status code 4xx or 5xx
|
85
86
|
end
|
86
87
|
end
|
87
88
|
|
88
89
|
def request(http_method:, endpoint:, params: {}, cache_ttl: 3600)
|
89
90
|
response = APICache.get(
|
90
91
|
Digest::SHA256.bubblebabble(config.token) + http_method.to_s + endpoint + params.to_s,
|
91
|
-
cache: cache_ttl
|
92
|
+
cache: cache_ttl,
|
93
|
+
timeout: config.timeout
|
92
94
|
) do
|
93
95
|
client.public_send(http_method, endpoint, params)
|
94
96
|
end
|