remotr 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/remotr/respondable.rb +3 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f5efcbebd596a18992884c915f5039645a510ee
|
4
|
+
data.tar.gz: c5101ae2ec484602a9ab3b7ae1a2206f950eb81d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a18994a149396fd08ed234d1b1c412c3ab6454cb01c5e0a31affe4688e5f1a81a22e2f0e4097e62b24d1c849a0ad51cf333a9bc3f3f718c6857775798477882f
|
7
|
+
data.tar.gz: 616c6ff39575735b1dcff80279467370d08c87000c02c764b41a68375f7cb189bb2a975365d241be331819557e3e0f8fcdb51e9765002a749b722994adc32d39
|
data/lib/remotr/respondable.rb
CHANGED
@@ -60,11 +60,10 @@ module Remotr
|
|
60
60
|
def respond_with(request_operation, namespace_to_use = namespace)
|
61
61
|
return request_operation if request_operation.failure?
|
62
62
|
httparty_response = request_operation.object
|
63
|
-
|
64
|
-
return Operations.failure(:response_missing_content_type, object: httparty_response) unless httparty_response.content_type
|
65
|
-
return Operations.failure(:response_is_not_json, object: httparty_response) unless httparty_response.content_type == 'application/json'
|
66
63
|
parsed_response = httparty_response.parsed_response
|
67
|
-
|
64
|
+
|
65
|
+
return Operations.failure(:response_is_not_parseable, object: httparty_response) unless parsed_response
|
66
|
+
return Operations.failure(:response_missing_success_flag, object: httparty_response) unless parsed_response && parsed_response.respond_to?(:key?) && parsed_response.key?('success')
|
68
67
|
|
69
68
|
code = parsed_response['code'].to_s != '' ? parsed_response['code'].to_sym : :response_unsuccessful
|
70
69
|
message = parsed_response['message'].to_s != '' ? parsed_response['message'] : code.to_s
|