usps-imis-api 0.6.2 → 0.6.3

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: a7e57bee906686721fa8b760f9fa322e04b289087e9295713283a2f6fcd5d3e6
4
- data.tar.gz: 6fe2a0b3405ddf20825ae24bb8986bf4e941a5fb46e37944988047faa5eb54e4
3
+ metadata.gz: eeff742b04ebe9046cb57d7cf8501b3a175a9e50729cba6f812f44ed12d90c43
4
+ data.tar.gz: 5960918afa1fd57e141cdd52408380ce135e53fa81eb7da4f9c48849436974ac
5
5
  SHA512:
6
- metadata.gz: e635a0d05fb1ce0139b422be14d01de9118bc2fa7474ee63eb802c5671a793e4628eea5d320ca93c59c41807419089243e6f1bd3bbc87dbda6c1baee2f06d28c
7
- data.tar.gz: a098bb43500c8db276cf03dd8b5f09954431b4a6011c6672656f061d05ca600972e70bab15ddd90877b62cedabb24f73d33575ea4ef5c6ef21d72e133f837cf7
6
+ metadata.gz: eb267af35e92cfa0c7511b1ed78eae72b6811569324486ea0f411dcf988c0f5d0515f079b0356cac0776555dd93b62f677fccc0fcf78ae43e424cb8f856469a6
7
+ data.tar.gz: 83c81ac9c0ef3ef658ae32c6de1026ec9aa5bea89f6f4e7bd2e0b5e7bcd6052562d93ab4d7f01db7b5bb4ab57e1eb1b00fe26a8121efeadf013cd2007a7e32e9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- usps-imis-api (0.6.2)
4
+ usps-imis-api (0.6.3)
5
5
  activesupport (~> 8.0)
6
6
 
7
7
  GEM
data/Readme.md CHANGED
@@ -13,7 +13,7 @@ gem install usps-imis-api
13
13
  or add this line to your Gemfile:
14
14
 
15
15
  ```ruby
16
- gem 'usps-imis-api', '~> 0.6.1'
16
+ gem 'usps-imis-api', '~> 0.6.3'
17
17
  ```
18
18
 
19
19
  ## Setup
@@ -87,6 +87,16 @@ api.imis_id = 31092
87
87
  data = api.on('ABC_ASC_Individual_Demog').get
88
88
  ```
89
89
 
90
+ ### GET Field
91
+
92
+ To fetch a specific field from member data, run e.g.:
93
+
94
+ ```ruby
95
+ api.imis_id = 31092
96
+
97
+ tot_mms = api.on('ABC_ASC_Individual_Demog').get_field('TotMMS')
98
+ ```
99
+
90
100
  ### PUT Fields
91
101
 
92
102
  To update member data, run e.g.:
@@ -204,7 +214,7 @@ previous value.
204
214
 
205
215
  ```ruby
206
216
  api.with(31092) do
207
- # These four requests are identical:
217
+ # These requests are identical:
208
218
 
209
219
  on('ABC_ASC_Individual_Demog') { put('TotMMS' => 15) }
210
220
 
@@ -222,6 +232,23 @@ api.with(6374) do
222
232
  end
223
233
  ```
224
234
 
235
+ ```ruby
236
+ api.with(31092) do
237
+ # These requests are identical:
238
+
239
+ api.on('ABC_ASC_Individual_Demog') do
240
+ get['Properties']['$values'].find { |hash| hash['Name'] == 'TotMMS' }['Value']['$value']
241
+ end
242
+
243
+ api.on('ABC_ASC_Individual_Demog') { get_field('TotMMS') }
244
+
245
+ api.on('ABC_ASC_Individual_Demog').get_field('TotMMS')
246
+ end
247
+
248
+ # This request fetches the same data, but leaves the iMIS ID selected
249
+ api.with(31092).on('ABC_ASC_Individual_Demog').get_field('TotMMS')
250
+ ```
251
+
225
252
  ## Exception Handling
226
253
 
227
254
  All internal exceptions inherit from `Usps::Imis::ApiError`.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Usps
4
4
  module Imis
5
- VERSION = '0.6.2'
5
+ VERSION = '0.6.3'
6
6
  end
7
7
  end
data/lib/usps/imis.rb CHANGED
@@ -6,6 +6,8 @@ require 'json'
6
6
  require 'time'
7
7
  require 'cgi'
8
8
 
9
+ require 'active_support/string_inquirer'
10
+
9
11
  # Extensions
10
12
  # :nocov:
11
13
  require 'ext/hash' unless defined?(Rails)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: usps-imis-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Fiander