remotr 1.0.1 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/remotr/respondable.rb +3 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12851189a061bb27e591ff38748c84e5145d930a
4
- data.tar.gz: 2aab34dd644d9c60fd318c23ca57c3f0e143c881
3
+ metadata.gz: 53fe2ebc522cbabbc2b9d7df0d82d1560d705af1
4
+ data.tar.gz: 4682d5e4a7542adcef81172d567f4ecccab8d482
5
5
  SHA512:
6
- metadata.gz: 68010968966867568fd8ea17157cf17ccfe680a848710ba4e68a4c9f392bcda6d60196ca65f344a58d27b8eae5e83f44f614c3da2ce22492be72506373ede9c3
7
- data.tar.gz: 1e235e0dca4cc4bbdd70006336540bbe959e8966a6401d73f6cf762af8d77b72b97a69543be921cb5b7ac04558d88d226d3732b2bb011075e3c6bc1a5e3c9b74
6
+ metadata.gz: 9f840c0ecf76356d6213639a835bfb888af05e20929168315c1c4e04016bfb23a0d61f076fc3b9b48a5be6cf5a5f1b214c458343e763294fb8f61e721d2af20c
7
+ data.tar.gz: 7abc649f75911020f79fb2337714cfd8c42e64ec81a0c25f2172a9102cd8e517243f32da8e4a9efa49134426557c7bf65e0d207016d300b157afa2e6136d64df
@@ -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 ? parsed_response[namespace_to_use.to_s] : nil
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 :request_succeeded, object: object, code: httparty_response.code, body: httparty_response.body
73
+ Operations.success code, object: object
73
74
 
74
75
  rescue JSON::ParserError
75
76
  Operations.failure :json_parsing_failed, object: httparty_response
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: remotr
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - bukowskis