decathlon-https 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/decathlon/https.rb +6 -2
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5e77e52e06d2a1439a50db956aa191d1546e841855335ab49ba8ee09f07b47d2
4
- data.tar.gz: db61d7f4884ea36931e238a2f3c246253b86a643ff810ff236c114ff4f5d2986
3
+ metadata.gz: ed30bcfe395a329f0f2217675bd09513bbd0bb378efe99f6f1582ac0a44f0ca8
4
+ data.tar.gz: a3e8870b643bc8dad06159eaa0f5384a87d6597e5fdae671b30398db51e0f70a
5
5
  SHA512:
6
- metadata.gz: 6c0d324ae1d0ba10408c1ac4b7cee0f7e1451df585a713a6f3573bae8fda5a68bbabd6931ea9fc6f3cdbb0c19caeec72ec14a2e1f057d4462f084c94848bb3db
7
- data.tar.gz: 1ee31ed60530112ec4e70bd189fb30c6daa9ee53501933abeeb21d474204ac028677e188d71228ab4eada0b88d7d1b74ea152c0f86986085536ca34b13df7aa5
6
+ metadata.gz: 9e73cfaf5d4a95d4615b31a47dcdbc00ba358eea039c61f26a68863efc1b4eebaf77786c1f10907290603bbd6a9cb5b9ca59961198471a3e17c692c182e85a04
7
+ data.tar.gz: 478b2e15b2783c79e402636cb5bf8d50f4d5154332d052b490adb050921222f2ab4b91fdf83ac8877edb42a2111d431b98fca3d538273dcedd27fa5d71806680
@@ -9,9 +9,9 @@ module Decathlon
9
9
  #
10
10
  module HTTPS
11
11
 
12
- VERSION = "0.1.1"
12
+ VERSION = '0.1.2'
13
13
 
14
- def self.json_api_request(base_url: '', params: {}, verb: :get, headers: {})
14
+ def self.json_api_request(base_url: '', params: {}, verb: :get, headers: {}, return_http_status_code: false)
15
15
 
16
16
  # Parse URI and build a new HTTPS client
17
17
  #
@@ -62,6 +62,10 @@ module Decathlon
62
62
  response = http.request(request)
63
63
  code = response.code.to_i
64
64
  body = response.body.to_s
65
+
66
+ # Return parsed body content, and status code if requested
67
+ #
68
+ return { body: JSON.parse(body, symbolize_names: true), code: code } if return_http_status_code == true
65
69
  return {} if code == 204 || (body.empty? && code < 400)
66
70
  return JSON.parse(body, symbolize_names: true)
67
71
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decathlon-https
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Hayter
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-07-14 00:00:00.000000000 Z
11
+ date: 2019-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  requirements: []
77
- rubygems_version: 3.0.3
77
+ rubygems_version: 3.0.4
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Simple abstraction library for making HTTPS JSON calls