ninja_van_api 0.3.5 → 0.3.6
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 +4 -4
- data/lib/ninja_van_api/client.rb +2 -2
- data/lib/ninja_van_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: 91d6c57ad7bfbccc1c8c2d31fd839b17f6bdc526bb11a2f3f8263aa605141115
|
4
|
+
data.tar.gz: db5d34a994d90e157a9ff866183147574582a2668be9d206772c1f1067ada136
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2c40f91e918341fe625b215119d61166ecd06cabccdaaeb3378d09c481ee95415441075d5021219ec117894140bcd0c42f93297c7b341cae7b4c4ddef0e1b1a
|
7
|
+
data.tar.gz: ca9183ac6cc14f0059884be61af0ed299d72936ea841e5cc14b66c035fbd2580dbffe877a29ce82e6658dd5e517ef6aa726791fe1095e0779ea0a07e7e4f9d23
|
data/lib/ninja_van_api/client.rb
CHANGED
@@ -61,7 +61,7 @@ module NinjaVanApi
|
|
61
61
|
def access_token
|
62
62
|
if Rails.env.development?
|
63
63
|
Rails.logger.debug "Access token might be expired. You can refetch the token by calling NinjaVanApi::Client#refresh_access_token. Make sure update the ENV variable NINJAVAN_API_ACCESS_TOKEN"
|
64
|
-
|
64
|
+
ENV.fetch("NINJAVAN_API_ACCESS_TOKEN")
|
65
65
|
end
|
66
66
|
|
67
67
|
fetch_access_token if token_expired?
|
@@ -99,7 +99,7 @@ module NinjaVanApi
|
|
99
99
|
|
100
100
|
token_info = JSON.parse(response.body)
|
101
101
|
Rails.cache.write(cache_key, token_info, expires_in: token_info["expires_in"])
|
102
|
-
|
102
|
+
token_info["access_token"]
|
103
103
|
end
|
104
104
|
|
105
105
|
def cache_key
|