json_requester 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -0
  3. data/lib/json_requester.rb +2 -2
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a2d4ed52990f4aef4fdf9e2cd0648f005e7470e0b9589f32318c89446e9fbbab
4
- data.tar.gz: 2aa352620aa571c8b19dcdf556bba9e89f6ffc5c3c515d772f7bd2b0788a4f9c
3
+ metadata.gz: 8352bed1c5d1f5cf27c68c6cd9655f396607dcbc727717d27513a0ecfd8eeccf
4
+ data.tar.gz: a75ba2ef8b8ba5dfc2c107fa0f528347cf2f60a16ffd809b1e93453a46485557
5
5
  SHA512:
6
- metadata.gz: 1872fdb58e459b0086a37106bfc654cacd05807a0c81992be6ef8ab51ec58dd938d08698d03216b78918cdf1ecac3ce1fcdb96870670854f3d9895c45d9e7d0e
7
- data.tar.gz: 95237fb35a77e6c4d3c7347ebfc1e0ef1435f67adab10a7966549187cda6e1af60562ba91b8fe974dfb2a6dff046af8511916c5dd124c64f547c55b6254b0653
6
+ metadata.gz: '0787a94609c76f42118122188beb92a0a14956438f50940f8aa51b1d0dbb4db54f63d8e1c0585cb00d64fcf7e96585ee1723fd2b93bfc74e1062cdfb9d1d9efc'
7
+ data.tar.gz: ec62f38838dcbc4a3404948b1c29cbc6eb4940dc5ce33f8dc959e9ca45a8e63c479205e9feac910638c10922ce4526a2a2b4aa6ec752796be1a3da3d9d012e72
data/README.md CHANGED
@@ -12,6 +12,7 @@
12
12
  res = requester.http_send(http_method, path, params, headers)
13
13
  puts res['status'] # 200
14
14
  puts res['body'] # { foo: 'bar' }
15
+ puts res['body_status'] # 'success'
15
16
 
16
17
  puts res['status'] # 500
17
18
  puts res['message'] # invalid method
@@ -81,7 +81,7 @@ class JsonRequester
81
81
  begin
82
82
  body = JSON.parse(response.body)
83
83
  body = body.is_a?(Hash) ? body : {'body' => body}
84
- body['body_status'] = body.delete('status') unless body['status'].is_a?(Integer)
84
+ body['body_status'] = body.delete('status') unless body['status'].nil?
85
85
  rescue
86
86
  body = {'body' => response.body}
87
87
  end
@@ -95,5 +95,5 @@ class JsonRequester
95
95
  def object_present?(object)
96
96
  !(object.nil? || object.empty?)
97
97
  end
98
-
98
+
99
99
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: json_requester
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - JiaRou Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-04 00:00:00.000000000 Z
11
+ date: 2021-12-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday