eligible 3.0.0.beta6 → 3.0.0.beta7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c58462c88e1d4cf4aa3b60f008ca5a442d85839ecef8d5f85c4ac84cbfb2da0
4
- data.tar.gz: af23adb1c0a3050115649b52bd3cd916dd56c4824e031ed93c7705349c4ed2a8
3
+ metadata.gz: 24d00007cfa0cb8d1880f5d8d4acf4d55cbff91c1fd96f229e701dd3e66146e7
4
+ data.tar.gz: d7910d231060b4cff2d5909a938c87ca47816ec61a86d71487385f5daa650766
5
5
  SHA512:
6
- metadata.gz: 006cde75666a3785b15f771191866b8ffbc31671431da34fae5b235608db0a65f70519b52008e49d4ca588e4784d0141939441720885918656883eaae864ac56
7
- data.tar.gz: bd0062f3e9c6f1e0926d3a4f31293cd7008cdb22385b26c65878315c2ef2b4e70460bd8ef5b655c40a17e2468211558793cf1a2151af12757642cc4b1d787b57
6
+ metadata.gz: a75f43c93dcb506a10563b41ba0080efabf5169ca3d729a442c54fe199b89f793bad6d40b607eaece80e08612c5f070d132ca55adeb6d05f4d282bc83f060d17
7
+ data.tar.gz: 8b6c75f3ec599fc5da988df06a924cb7824a5c147a4fb1cb9c7e6b5887e0cea8debb8fb06d1497343b7914bf76878fa18b823e32c29ea6da7c582de935ccf5ee
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.0.0.beta7 - 2020-04-16
4
+ - Removed un-wanted parameters from the API request while making calls to new REST API endpoint
5
+
3
6
  ## 3.0.0.beta6 - 2020-04-08
4
7
  - Bug fix for "PatientStatement" endpoint
5
8
 
@@ -224,7 +224,8 @@ module Eligible
224
224
  # GET requests, parameters on the query string
225
225
  # POST requests, parameters as json in the body
226
226
  url = api_url(url, options[:rest_api_version])
227
-
227
+ # Used rest_api_version param only to identify new REST API version, and is not required to make calls for new REST api endpoints
228
+ params.delete(:rest_api_version)
228
229
  case method.to_s.downcase.to_sym
229
230
  when :get, :head, :delete
230
231
  url = fetch_url_with_query_string(params, url, options)
@@ -237,18 +238,24 @@ module Eligible
237
238
  end
238
239
 
239
240
  def self.fetch_url_with_query_string(params, url, options)
240
- url += "?test=#{options[:test]}"
241
- url += "&api_key=#{options[:api_key]}" unless options[:basic_auth]
241
+ url += options_query_string(options)
242
242
  return url unless params || params.count == 0
243
243
 
244
- query_string = Util.flatten_params(params).collect { |key, value| "#{key}=#{Util.url_encode(value)}" }.join('&')
245
- url += "&#{query_string}"
244
+ query_string = params_query_string(params)
245
+ url += options[:basic_auth] ? "?#{query_string}" : "&#{query_string}"
246
246
  url
247
247
  end
248
248
 
249
+ def self.options_query_string(options)
250
+ options[:basic_auth] ? '' : "?test=#{options[:test]}&api_key=#{options[:api_key]}"
251
+ end
252
+
253
+ def self.params_query_string(params)
254
+ Util.flatten_params(params).collect { |key, value| "#{key}=#{Util.url_encode(value)}" }.join('&')
255
+ end
256
+
249
257
  def self.request_payload(options, params)
250
- params.merge!('test' => options[:test])
251
- params.merge!('api_key' => options[:api_key]) unless options[:basic_auth]
258
+ params.merge!('test' => options[:test], 'api_key' => options[:api_key]) unless options[:basic_auth]
252
259
  Util.key?(params, :file) ? params : Eligible::JSON.dump(params)
253
260
  end
254
261
 
@@ -1,3 +1,3 @@
1
1
  module Eligible
2
- VERSION = '3.0.0.beta6'.freeze
2
+ VERSION = '3.0.0.beta7'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eligible
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta6
4
+ version: 3.0.0.beta7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katelyn Gleaon
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2020-04-13 00:00:00.000000000 Z
13
+ date: 2020-04-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rest-client