lob 4.2.0 → 4.3.0

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: 3476691f58ba7bfaf6cbedb44a75cdbd249d51e7
4
- data.tar.gz: 9d1d4215c142196c340e4abcdc75d0a0117c1382
2
+ SHA256:
3
+ metadata.gz: 8225f20dd05a0f5b903f986a88f5e93254dec38e28361076a9724cfef0c50661
4
+ data.tar.gz: d0e4ccd13e9bd6f5b9b4010f48a7b6e9f2926c57de5a6a914d4f6153ecfd43a0
5
5
  SHA512:
6
- metadata.gz: 07ccac963f8d375d83a79434311be0a954def5a529d3cda0df193198dfe24d2a795e8e713299cf098f4129f832d06432633fa183a0fb2ca499f010790ef9e1fc
7
- data.tar.gz: 1de8c5fcae8eb8b1ddeb2e7d8235525476db6f554f53d1ab106204bac42fcdf63ee4b81c50b904670b709bd6157866eec7d0182ac854ed96bd32382e4fc1bd3c
6
+ metadata.gz: 7f21d43ad6e066f4c94d00365d92bc155947bd4c56c2b0794aebfcecd75cd9f5189dab7583a39585eedc8060a788d0fa20ee6111097291ddefb06ef7f38ae37e
7
+ data.tar.gz: c8df84c18215df4af65573cd1109b80d6bb053160a5958a867cfc5ab0bfcf3b09f9bb568c2235e4830a1c270f69512ae9727ea2704312316043e1d6073fdf581
@@ -1,3 +1,7 @@
1
+ ## [**4.3.0**](https://github.com/lob/lob-ruby/releases/tag/v4.3.0)
2
+ - [**171**](https://github.com/lob/lob-ruby/pull/171) add USAutocompletions
3
+ - [**170**](https://github.com/lob/lob-ruby/pull/170) Fix test name
4
+
1
5
  ## [**4.2.0**](https://github.com/lob/lob-ruby/releases/tag/v4.2.0)
2
6
  - [**169**](https://github.com/lob/lob-ruby/pull/169) Support 'case' param for us_verifications
3
7
  - [**168**](https://github.com/lob/lob-ruby/pull/168) tweak wording around handling numbers with leading zeros
data/README.md CHANGED
@@ -122,66 +122,70 @@ There are simple scripts to demonstrate how to create all the core Lob objects (
122
122
  - [HTML Templates](https://lob.com/docs/ruby#templates)
123
123
  - [Asset URLs](https://lob.com/docs/ruby#urls)
124
124
  - **Addresses**
125
- - [Address Book](https://lob.com/docs/ruby#addresses)
126
- - [The Address Object](https://lob.com/docs/ruby#addresses_object)
127
- - [Create an Address](https://lob.com/docs/ruby#addresses_create)
128
- - [Retrieve an Address](https://lob.com/docs/ruby#addresses_retrieve)
129
- - [Delete an Address](https://lob.com/docs/ruby#addresses_delete)
130
- - [List all Addresses](https://lob.com/docs/ruby#addresses_list)
125
+ - [Address Book](https://lob.com/docs/ruby#addresses)
126
+ - [The Address Object](https://lob.com/docs/ruby#addresses_object)
127
+ - [Create an Address](https://lob.com/docs/ruby#addresses_create)
128
+ - [Retrieve an Address](https://lob.com/docs/ruby#addresses_retrieve)
129
+ - [Delete an Address](https://lob.com/docs/ruby#addresses_delete)
130
+ - [List all Addresses](https://lob.com/docs/ruby#addresses_list)
131
131
  - **US Verification API**
132
- - [US Verification API](https://lob.com/docs/ruby#us_verifications)
133
- - [The US Verification Object](https://lob.com/docs/ruby#us_verifications_object)
134
- - [Verify a US Address](https://lob.com/docs/ruby#us_verifications_create)
135
- - [The US Zip Lookup Object](https://lob.com/docs/ruby#us_zip_lookups_object)
136
- - [Lookup a US Zip Code](https://lob.com/docs/ruby#us_zip_lookups_create)
132
+ - [US Verification API](https://lob.com/docs/ruby#us_verifications)
133
+ - [The US Verification Object](https://lob.com/docs/ruby#us_verifications_object)
134
+ - [Verify a US Address](https://lob.com/docs/ruby#us_verifications_create)
135
+ - [The US Zip Lookup Object](https://lob.com/docs/ruby#us_zip_lookups_object)
136
+ - [Lookup a US Zip Code](https://lob.com/docs/ruby#us_zip_lookups_create)
137
+ - [US Autocompletion API](https://lob.com/docs/ruby#us_autocompletions)
138
+ - [The US Autocompletion Object](https://lob.com/docs/ruby#us_autocompletions_object)
139
+ - [Autocomplete a US Address](https://lob.com/docs/ruby#us_autocompletions_create)
140
+ - [The US Autocompletion Test Environment](https://lob.com/docs/ruby#us-autocompletions-test-environment)
137
141
  - **Int'l Verification API**
138
- - [International Verifications](https://lob.com/docs/ruby#intl_verifications)
139
- - [Verify an International Address](https://lob.com/docs/ruby#intl_verifications_create)
142
+ - [International Verifications](https://lob.com/docs/ruby#intl_verifications)
143
+ - [Verify an International Address](https://lob.com/docs/ruby#intl_verifications_create)
140
144
  - **Postcards API**
141
- - [Postcards](https://lob.com/docs/ruby#postcards)
142
- - [The Postcard Object](https://lob.com/docs/ruby#postcards_object)
143
- - [Create a Postcard](https://lob.com/docs/ruby#postcards_create)
144
- - [Retrieve a Postcard](https://lob.com/docs/ruby#postcards_retrieve)
145
- - [Cancel a Postcard](https://lob.com/docs/ruby#postcards_delete)
146
- - [List all Postcards](https://lob.com/docs/ruby#postcards_list)
145
+ - [Postcards](https://lob.com/docs/ruby#postcards)
146
+ - [The Postcard Object](https://lob.com/docs/ruby#postcards_object)
147
+ - [Create a Postcard](https://lob.com/docs/ruby#postcards_create)
148
+ - [Retrieve a Postcard](https://lob.com/docs/ruby#postcards_retrieve)
149
+ - [Cancel a Postcard](https://lob.com/docs/ruby#postcards_delete)
150
+ - [List all Postcards](https://lob.com/docs/ruby#postcards_list)
147
151
  - **Letters API**
148
- - [Letters](https://lob.com/docs/ruby#letters)
149
- - [The Letter Object](https://lob.com/docs/ruby#letters_object)
150
- - [Create a Letter](https://lob.com/docs/ruby#letters_create)
151
- - [Retrieve a Letter](https://lob.com/docs/ruby#letters_retrieve)
152
- - [Cancel a Letter](https://lob.com/docs/ruby#letters_delete)
153
- - [List all Letters](https://lob.com/docs/ruby#letters_list)
152
+ - [Letters](https://lob.com/docs/ruby#letters)
153
+ - [The Letter Object](https://lob.com/docs/ruby#letters_object)
154
+ - [Create a Letter](https://lob.com/docs/ruby#letters_create)
155
+ - [Retrieve a Letter](https://lob.com/docs/ruby#letters_retrieve)
156
+ - [Cancel a Letter](https://lob.com/docs/ruby#letters_delete)
157
+ - [List all Letters](https://lob.com/docs/ruby#letters_list)
154
158
  - **Checks API**
155
- - [Checks](https://lob.com/docs/ruby#checks)
156
- - [The Check Object](https://lob.com/docs/ruby#checks_object)
157
- - [Create a Check](https://lob.com/docs/ruby#checks_create)
158
- - [Retrieve a Check](https://lob.com/docs/ruby#checks_retrieve)
159
- - [Cancel a Check](https://lob.com/docs/ruby#checks_delete)
160
- - [List all Checks](https://lob.com/docs/ruby#checks_list)
161
- - [Bank Accounts](https://lob.com/docs/ruby#bank-accounts)
162
- - [The Bank Account Object](https://lob.com/docs/ruby#bankaccounts_object)
163
- - [Create a Bank Account](https://lob.com/docs/ruby#bankaccounts_create)
164
- - [Retrieve a Bank Account](https://lob.com/docs/ruby#bankaccounts_retrieve)
165
- - [Delete a Bank Account](https://lob.com/docs/ruby#bankaccounts_delete)
166
- - [Verify a Bank Account](https://lob.com/docs/ruby#bankaccounts_verify)
167
- - [List all Bank Accounts](https://lob.com/docs/ruby#bankaccounts_list)
159
+ - [Checks](https://lob.com/docs/ruby#checks)
160
+ - [The Check Object](https://lob.com/docs/ruby#checks_object)
161
+ - [Create a Check](https://lob.com/docs/ruby#checks_create)
162
+ - [Retrieve a Check](https://lob.com/docs/ruby#checks_retrieve)
163
+ - [Cancel a Check](https://lob.com/docs/ruby#checks_delete)
164
+ - [List all Checks](https://lob.com/docs/ruby#checks_list)
165
+ - [Bank Accounts](https://lob.com/docs/ruby#bank-accounts)
166
+ - [The Bank Account Object](https://lob.com/docs/ruby#bankaccounts_object)
167
+ - [Create a Bank Account](https://lob.com/docs/ruby#bankaccounts_create)
168
+ - [Retrieve a Bank Account](https://lob.com/docs/ruby#bankaccounts_retrieve)
169
+ - [Delete a Bank Account](https://lob.com/docs/ruby#bankaccounts_delete)
170
+ - [Verify a Bank Account](https://lob.com/docs/ruby#bankaccounts_verify)
171
+ - [List all Bank Accounts](https://lob.com/docs/ruby#bankaccounts_list)
168
172
  - **Area Mail API**
169
- - [Areas](https://lob.com/docs/ruby#areas)
170
- - [The Area Object](https://lob.com/docs/ruby#areas_object)
171
- - [Create an Area Mailing](https://lob.com/docs/ruby#areas_create)
172
- - [Retrieve an Area Mailing](https://lob.com/docs/ruby#areas_retrieve)
173
- - [List all Area Mailings](https://lob.com/docs/ruby#areas_list)
174
- - [Routes](https://lob.com/docs/ruby#routes)
175
- - [The Routes Object](https://lob.com/docs/ruby#routes_object)
176
- - [Retrieve Routes](https://lob.com/docs/ruby#routes_retrieve)
177
- - [List all Routes](https://lob.com/docs/ruby#routes_list)
173
+ - [Areas](https://lob.com/docs/ruby#areas)
174
+ - [The Area Object](https://lob.com/docs/ruby#areas_object)
175
+ - [Create an Area Mailing](https://lob.com/docs/ruby#areas_create)
176
+ - [Retrieve an Area Mailing](https://lob.com/docs/ruby#areas_retrieve)
177
+ - [List all Area Mailings](https://lob.com/docs/ruby#areas_list)
178
+ - [Routes](https://lob.com/docs/ruby#routes)
179
+ - [The Routes Object](https://lob.com/docs/ruby#routes_object)
180
+ - [Retrieve Routes](https://lob.com/docs/ruby#routes_retrieve)
181
+ - [List all Routes](https://lob.com/docs/ruby#routes_list)
178
182
  - **Appendix**
179
- - [API Changelog](https://lob.com/docs/ruby#changelog)
180
- - [The Tracking Event Object](https://lob.com/docs/ruby#tracking_event_object)
181
- - [Events](https://lob.com/docs/ruby#events)
182
- - [HTML Examples](https://lob.com/docs/ruby#html-examples)
183
- - [Image Prepping](https://lob.com/docs/ruby#prepping)
184
- - [US Verification Details](https://lob.com/docs/ruby#us_verification_details)
183
+ - [API Changelog](https://lob.com/docs/ruby#changelog)
184
+ - [The Tracking Event Object](https://lob.com/docs/ruby#tracking_event_object)
185
+ - [Events](https://lob.com/docs/ruby#events)
186
+ - [HTML Examples](https://lob.com/docs/ruby#html-examples)
187
+ - [Image Prepping](https://lob.com/docs/ruby#prepping)
188
+ - [US Verification Details](https://lob.com/docs/ruby#us_verification_details)
185
189
 
186
190
  ## Contributing
187
191
 
@@ -6,6 +6,7 @@ require "lob/resources/intl_verifications"
6
6
  require "lob/resources/letter"
7
7
  require "lob/resources/postcard"
8
8
  require "lob/resources/route"
9
+ require "lob/resources/us_autocompletions"
9
10
  require "lob/resources/us_verifications"
10
11
  require "lob/resources/us_zip_lookups"
11
12
 
@@ -54,6 +55,10 @@ module Lob
54
55
  Lob::Resources::Route.new(config)
55
56
  end
56
57
 
58
+ def us_autocompletions
59
+ Lob::Resources::USAutocompletions.new(config)
60
+ end
61
+
57
62
  def us_verifications
58
63
  Lob::Resources::USVerifications.new(config)
59
64
  end
@@ -0,0 +1,26 @@
1
+ require "lob/resources/resource_base"
2
+
3
+ module Lob
4
+ module Resources
5
+ class USAutocompletions < Lob::Resources::ResourceBase
6
+
7
+ undef_method :list, :find, :create, :destroy
8
+
9
+ def initialize(config)
10
+ super(config)
11
+ @endpoint = "us_autocompletions"
12
+ end
13
+
14
+ def autocomplete(body={})
15
+ request = {
16
+ method: :post,
17
+ url: endpoint_url,
18
+ body: body
19
+ }
20
+
21
+ submit request
22
+ end
23
+
24
+ end
25
+ end
26
+ end
@@ -1,3 +1,3 @@
1
1
  module Lob
2
- VERSION = "4.2.0"
2
+ VERSION = "4.3.0"
3
3
  end
@@ -0,0 +1,24 @@
1
+ require "spec_helper"
2
+
3
+ describe Lob::Resources::USAutocompletions do
4
+
5
+ before :each do
6
+ @sample_params = {
7
+ address_prefix: "185 BER",
8
+ city: "SAN FRANCISCO",
9
+ state: "CA"
10
+ }
11
+ end
12
+
13
+ subject { Lob::Client.new(api_key: API_KEY) }
14
+
15
+ describe "autocomplete" do
16
+ it "should return a list of address suggestions" do
17
+ result = subject.us_autocompletions.autocomplete @sample_params
18
+
19
+ result["suggestions"][0]["primary_line"].must_equal("TEST KEYS DO NOT AUTOCOMPLETE US ADDRESSES")
20
+ result["suggestions"][0]["city"].must_equal("SET `address_prefix` to '1 suggestion' TO SIMULATE AN AUTOCOMPLETION")
21
+ end
22
+ end
23
+
24
+ end
@@ -21,7 +21,7 @@ describe Lob::Resources::USVerifications do
21
21
  result["recipient"].must_equal("TEST KEYS DO NOT VERIFY ADDRESSES")
22
22
  end
23
23
 
24
- it "should verify a US address" do
24
+ it "should allow 'case' in query params" do
25
25
  result = subject.us_verifications.verify @sample_params, {case: "proper"}
26
26
 
27
27
  result["recipient"].must_equal("Test Keys Do Not Verify Addresses")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lob
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.0
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lob
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-13 00:00:00.000000000 Z
11
+ date: 2018-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -185,6 +185,7 @@ files:
185
185
  - lib/lob/resources/postcard.rb
186
186
  - lib/lob/resources/resource_base.rb
187
187
  - lib/lob/resources/route.rb
188
+ - lib/lob/resources/us_autocompletions.rb
188
189
  - lib/lob/resources/us_verifications.rb
189
190
  - lib/lob/resources/us_zip_lookups.rb
190
191
  - lib/lob/version.rb
@@ -199,6 +200,7 @@ files:
199
200
  - spec/lob/resources/postcard_spec.rb
200
201
  - spec/lob/resources/resource_base_spec.rb
201
202
  - spec/lob/resources/route_spec.rb
203
+ - spec/lob/resources/us_autocompletions_spec.rb
202
204
  - spec/lob/resources/us_verifications_spec.rb
203
205
  - spec/lob/resources/us_zip_lookups_spec.rb
204
206
  - spec/lob_spec.rb
@@ -226,7 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
226
228
  version: '0'
227
229
  requirements: []
228
230
  rubyforge_project:
229
- rubygems_version: 2.6.6
231
+ rubygems_version: 2.7.7
230
232
  signing_key:
231
233
  specification_version: 4
232
234
  summary: Ruby wrapper for Lob.com API with ActiveRecord-style syntax
@@ -241,6 +243,7 @@ test_files:
241
243
  - spec/lob/resources/postcard_spec.rb
242
244
  - spec/lob/resources/resource_base_spec.rb
243
245
  - spec/lob/resources/route_spec.rb
246
+ - spec/lob/resources/us_autocompletions_spec.rb
244
247
  - spec/lob/resources/us_verifications_spec.rb
245
248
  - spec/lob/resources/us_zip_lookups_spec.rb
246
249
  - spec/lob_spec.rb