rail-locator-api 1.0.32 → 1.0.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rail-locator-api/api_request.rb +2 -0
- data/lib/rail-locator-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: ccb40fb17c07a91468660c4bf642e94c902c6468395c9f66a91a01bd186e122d
|
4
|
+
data.tar.gz: d06c77b47de8ee341e08945dcd229440efc615fd6456d80832c7e1178344cdf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ed439487c1336378a567afdccb504fbdfc4e979a5d3d71328eef300bdc7fe871ba589a109769cb4e135c204ed0b0e1d2a9b91432e909920bf4205e8059891ee
|
7
|
+
data.tar.gz: eb0964dcc6902a1758602daad125b961a5a8dca96d3e65d018dd638e24ecae19426bfd1fcaa48015db3772e6b36bfd16b96b021a0be7866264828d82a8cdd06a
|
@@ -8,6 +8,7 @@ module RailLocatorApi
|
|
8
8
|
def post(params: nil, headers: nil, format: nil, body: {})
|
9
9
|
validate_api_key
|
10
10
|
begin
|
11
|
+
headers ||= {}
|
11
12
|
if is_multipart?(body)
|
12
13
|
if self.api_auth_method == :base64
|
13
14
|
headers['Authorization'] = "Basic " + Base64::encode64("#{self.api_user_email}:#{self.api_user_password}")
|
@@ -273,6 +274,7 @@ module RailLocatorApi
|
|
273
274
|
end
|
274
275
|
|
275
276
|
def is_multipart?(body, result=false)
|
277
|
+
return false if body == {}
|
276
278
|
if body.is_a?(Hash)
|
277
279
|
body.inject({}) do |acc, kv|
|
278
280
|
result = is_multipart?(kv.last, result)
|