remotr 1.0.1 → 1.1.1
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 -2
- 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: 53fe2ebc522cbabbc2b9d7df0d82d1560d705af1
|
4
|
+
data.tar.gz: 4682d5e4a7542adcef81172d567f4ecccab8d482
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f840c0ecf76356d6213639a835bfb888af05e20929168315c1c4e04016bfb23a0d61f076fc3b9b48a5be6cf5a5f1b214c458343e763294fb8f61e721d2af20c
|
7
|
+
data.tar.gz: 7abc649f75911020f79fb2337714cfd8c42e64ec81a0c25f2172a9102cd8e517243f32da8e4a9efa49134426557c7bf65e0d207016d300b157afa2e6136d64df
|
data/lib/remotr/respondable.rb
CHANGED
@@ -67,9 +67,10 @@ module Remotr
|
|
67
67
|
return Operations.failure(:response_missing_success_flag, object: httparty_response) unless parsed_response && parsed_response.key?('success')
|
68
68
|
return Operations.failure(:response_unsuccessful, object: httparty_response) if parsed_response['success'].to_s != 'true'
|
69
69
|
|
70
|
-
object = parsed_response
|
70
|
+
object = parsed_response[namespace_to_use.to_s]
|
71
|
+
code = parsed_response['code'].to_s != '' ? parsed_response['code'].to_sym : :request_succeeded
|
71
72
|
|
72
|
-
Operations.success
|
73
|
+
Operations.success code, object: object
|
73
74
|
|
74
75
|
rescue JSON::ParserError
|
75
76
|
Operations.failure :json_parsing_failed, object: httparty_response
|