nds_api 0.1.14 → 0.1.15

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
- SHA1:
3
- metadata.gz: 04c5d5f2ac111a54c0f8f6e2bdb194bd3ff30a2c
4
- data.tar.gz: a1f41ea35a339d9d162e7d117ae31acc8af242e6
2
+ SHA256:
3
+ metadata.gz: bc05d4e068c833f663cdd0f3c2651290c8ce55d51991544f9989a87d2b05d638
4
+ data.tar.gz: 06477fa1309fb2ca11f725171d5b63a6f17a1318c9cff0d8c0a9ef77f2de06c6
5
5
  SHA512:
6
- metadata.gz: 9e4a83d7f4f579cf29da7e41b25642a69c6512cbbf9fe2e8c73a11ba6d0c279a6b21b9afd20d1404881fe79ea4da0a129fcf48f54a790267e073e6bf9ecf42cb
7
- data.tar.gz: 9374cf299341eb897be645ce13f699a23d663cd654b81ee35c8f02dc60822aedfb6421ee47cdd357e4007f7f6bec7700c30bfd11716fc791a8ba15efb7a22901
6
+ metadata.gz: ae60ec509a3140651a109b7312d6e4014cd3b08f59b8e875839ec5abeb753946f2bfbce47f540d392a670fe1c7bb0e8e591de058e9d7a2b2261b950d851df257
7
+ data.tar.gz: a4cb1b22b326320db91c870a5b59aa0f803af471376d4118f4370aebcb02b9a844d8ed777cb7582819badfee208f307c00862b0023e263a2c7007bd6e458e84b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nds_api (0.1.14)
4
+ nds_api (0.1.15)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -24,7 +24,9 @@ Or install it yourself as:
24
24
  nds = NdsApi::Client.new(
25
25
  user: 'username', #required
26
26
  password: '############', #required
27
- agency_key: 123 # optionals
27
+ agency_key: 123, # optionals
28
+ dev: false, # optionals
29
+ debug: false # optionals
28
30
  )
29
31
  ```
30
32
 
@@ -107,6 +109,7 @@ nds.search_providers(search_params)
107
109
  nds.update_provider(data)
108
110
 
109
111
  nds.providers()
112
+ nds.search_providers_bulk(providerIds: [123, 234, 345])
110
113
  nds.provider_by_uid(uid)
111
114
  nds.provider_by_id(id)
112
115
  nds.providers_by_center_name(center_name)
@@ -141,7 +144,7 @@ Test GEM
141
144
  `bin/console`
142
145
 
143
146
  ```ruby
144
- NdsApi::Client.new(agency_key: 00000, user: 'user', password: 'password', dev: true).provider_by_id(1234)
147
+ NdsApi::Client.new(agency_key: 00000, user: 'user', password: 'password', dev: true, debug: true).provider_by_id(1234)
145
148
  ```
146
149
 
147
150
  ## Publication
@@ -12,6 +12,7 @@ module NdsApi
12
12
  # @option options [String] :user NDS User
13
13
  # @option options [String] :password NDS Password
14
14
  # @option options [String] :agency_key NDS Agency Key
15
+ # @option options [Boolean] :debug
15
16
  #
16
17
  # @return [NdsApi::Client] new client instance
17
18
 
@@ -24,8 +25,10 @@ module NdsApi
24
25
  def method_missing(method, *args, &block)
25
26
  @method = NdsApi::Method.new(method)
26
27
  @args = *args
27
- response = http_action(method, *args, &block)
28
- NdsApi::Utils.hash_keys_str_to_sym(response)
28
+ console_debug(step: 1)
29
+ @response = http_action(method, *args, &block)
30
+ console_debug(step: 2)
31
+ NdsApi::Utils.hash_keys_str_to_sym(@response)
29
32
  end
30
33
 
31
34
  private
@@ -36,6 +39,7 @@ module NdsApi
36
39
  elsif @method.is_update?
37
40
  @http.put(url, data)
38
41
  else
42
+ console_debug(url: @url.send(method, *args))
39
43
  @http.get(@url.send(method, *args))
40
44
  end
41
45
  end
@@ -55,5 +59,22 @@ module NdsApi
55
59
  def query_params
56
60
  @args.count > 1 ? @args[1] : nil
57
61
  end
62
+
63
+ def console_debug(params)
64
+ return unless @options[:debug]
65
+ if params[:step] == 1
66
+ params_to_display = @options.dup
67
+ params_to_display[:password] = 'XXXXXXXXXXXXXXX'
68
+ puts "NDS API GEM PARAMS: #{params_to_display}"
69
+ if @method.is_create? || @method.is_search? || @method.is_update?
70
+ puts "NDS API DEBUG: #{@method.is_update? ? 'PUT' : 'POST'}"
71
+ puts "NDS API DEBUG: URL: #{url.inspect}"
72
+ else
73
+ puts 'NDS API DEBUG: METHOD GET'
74
+ end
75
+ end
76
+ puts "NDS API DEBUG: RESPONSE: #{@response.inspect}" if params[:step] == 2
77
+ puts "NDS API DEBUG: URL: #{params[:url]}" if params[:url]
78
+ end
58
79
  end
59
80
  end
@@ -1,3 +1,3 @@
1
1
  module NdsApi
2
- VERSION = '0.1.14'.freeze
2
+ VERSION = '0.1.15'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nds_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.14
4
+ version: 0.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre Hunault
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-09-10 00:00:00.000000000 Z
11
+ date: 2018-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -85,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
85
  version: '0'
86
86
  requirements: []
87
87
  rubyforge_project:
88
- rubygems_version: 2.6.14
88
+ rubygems_version: 2.7.7
89
89
  signing_key:
90
90
  specification_version: 4
91
91
  summary: NDS API is a Rubygem for easy interface with the NDS API. https://developer.uatup.naccrraware.net/