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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d3dd0bcdc9ebfcf65816cd8ac2b54bd3e38ca4939afb5ea3542d1613e6764f7
4
- data.tar.gz: 8d3fb583ea0f45a79035c604a64fa1068500127c73fa705f14a4104e60d626c8
3
+ metadata.gz: 738b039ce921a5d93329f37ae2591232a237d77bbfb31ce9e77405800565ea4b
4
+ data.tar.gz: 52ce2629fd1cbe2502996c08eaec1453f24fe194960f50cbd2e77a0380e190ea
5
5
  SHA512:
6
- metadata.gz: d2f952635355a4490fb1a50fe940862e4f32402ed40146452dc1fdd513398b3dfed40721be0ceeb282356c35c417ca00bcf4f630a140b9d83fe579a9c49f328c
7
- data.tar.gz: ca24a9515fadbbd2be6da20dcb1b88d1ee2c5d41d7ed51af11f26a41b20917ac37f0666d7f6e28c7b5b512195b623a475bb337b51b45b236d1ba58dac4fb72af
6
+ metadata.gz: f8fbc83b647ba08bfaaae2b609ff3d1e23fefe48d1f55e9ff15387f103ac95c0a7e12d775115b547849b1ba526a418a66a91b1ba8ac6a8a17c7d6173c53313d2
7
+ data.tar.gz: da9ca9eb3fc3b60aa7a9f00601d21e8eac365be0aa15264410c13dec97853207addbb2ddf3cc67eb3cabf509a026a8b1b082d30ca7e2012910364d1cf27f206e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fantasticstay_api (0.1.6)
4
+ fantasticstay_api (0.1.7)
5
5
  api_cache (~> 0.3.0)
6
6
  dry-configurable (~> 0.13)
7
7
  faraday (~> 2.6.0)
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FantasticstayApi
4
- VERSION = '0.1.7'
4
+ VERSION = '0.1.8'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fantasticstay_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dinis