lob 4.3.0 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +7 -0
- data/README.md +0 -11
- data/lib/lob/client.rb +0 -10
- data/lib/lob/version.rb +1 -1
- data/spec/lob/resources/resource_base_spec.rb +0 -8
- metadata +3 -9
- data/lib/lob/resources/area.rb +0 -16
- data/lib/lob/resources/route.rb +0 -33
- data/spec/lob/resources/area_spec.rb +0 -59
- data/spec/lob/resources/route_spec.rb +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 82cb4d2c08d73f1a0c9a9f894e9ab667d9fb21c7
|
4
|
+
data.tar.gz: 21ee072bff001b317e143c816c1846ea5862c328
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2dbc48bdf335100921f6e0310a151142c08f58afe123837dd0782fd043f232f6cd952447f8ab67ca32db5f93d2e3a48de0877f462b572bdfff03bf8749ad78d
|
7
|
+
data.tar.gz: 4909bb74ee1dcf52dcbd35bc0ececa581766d7cac52e2c982811fb3ff002cbfc0023ff6318772d3a64289fc4cd728060d0c718bda292f20c5469904305698d8c
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 5.0.0
|
2
|
+
|
3
|
+
Version 5.0.0 introduces a breaking change. It removes support for the area mail resources (`Areas` and `Routes`).
|
4
|
+
|
5
|
+
* Removes `Lob.areas`.
|
6
|
+
* Removes `Lob.routes`.
|
7
|
+
|
1
8
|
## [**4.3.0**](https://github.com/lob/lob-ruby/releases/tag/v4.3.0)
|
2
9
|
- [**171**](https://github.com/lob/lob-ruby/pull/171) add USAutocompletions
|
3
10
|
- [**170**](https://github.com/lob/lob-ruby/pull/170) Fix test name
|
data/README.md
CHANGED
@@ -28,7 +28,6 @@ Here's a general overview of the Lob services available, click through to read m
|
|
28
28
|
- [Postcards API](https://lob.com/services/postcards)
|
29
29
|
- [Letters API](https://lob.com/services/letters)
|
30
30
|
- [Checks API](https://lob.com/services/checks)
|
31
|
-
- [Area Mail API](https://lob.com/services/area)
|
32
31
|
- [Address Verification API](https://lob.com/services/verifications)
|
33
32
|
|
34
33
|
Please read through the official [API Documentation](#api-documentation) to get a complete sense of what to expect from each endpoint.
|
@@ -169,16 +168,6 @@ There are simple scripts to demonstrate how to create all the core Lob objects (
|
|
169
168
|
- [Delete a Bank Account](https://lob.com/docs/ruby#bankaccounts_delete)
|
170
169
|
- [Verify a Bank Account](https://lob.com/docs/ruby#bankaccounts_verify)
|
171
170
|
- [List all Bank Accounts](https://lob.com/docs/ruby#bankaccounts_list)
|
172
|
-
- **Area Mail API**
|
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)
|
182
171
|
- **Appendix**
|
183
172
|
- [API Changelog](https://lob.com/docs/ruby#changelog)
|
184
173
|
- [The Tracking Event Object](https://lob.com/docs/ruby#tracking_event_object)
|
data/lib/lob/client.rb
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
require "lob/resources/address"
|
2
|
-
require "lob/resources/area"
|
3
2
|
require "lob/resources/bank_account"
|
4
3
|
require "lob/resources/check"
|
5
4
|
require "lob/resources/intl_verifications"
|
6
5
|
require "lob/resources/letter"
|
7
6
|
require "lob/resources/postcard"
|
8
|
-
require "lob/resources/route"
|
9
7
|
require "lob/resources/us_autocompletions"
|
10
8
|
require "lob/resources/us_verifications"
|
11
9
|
require "lob/resources/us_zip_lookups"
|
@@ -23,10 +21,6 @@ module Lob
|
|
23
21
|
@config = config
|
24
22
|
end
|
25
23
|
|
26
|
-
def areas
|
27
|
-
Lob::Resources::Area.new(config)
|
28
|
-
end
|
29
|
-
|
30
24
|
def addresses
|
31
25
|
Lob::Resources::Address.new(config)
|
32
26
|
end
|
@@ -51,10 +45,6 @@ module Lob
|
|
51
45
|
Lob::Resources::Postcard.new(config)
|
52
46
|
end
|
53
47
|
|
54
|
-
def routes
|
55
|
-
Lob::Resources::Route.new(config)
|
56
|
-
end
|
57
|
-
|
58
48
|
def us_autocompletions
|
59
49
|
Lob::Resources::USAutocompletions.new(config)
|
60
50
|
end
|
data/lib/lob/version.rb
CHANGED
@@ -14,10 +14,6 @@ describe Lob::Resources::ResourceBase do
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
it "should return areas resource" do
|
18
|
-
subject.areas.must_be_kind_of(Lob::Resources::Area)
|
19
|
-
end
|
20
|
-
|
21
17
|
it "should return addresses resource" do
|
22
18
|
subject.addresses.must_be_kind_of(Lob::Resources::Address)
|
23
19
|
end
|
@@ -38,10 +34,6 @@ describe Lob::Resources::ResourceBase do
|
|
38
34
|
subject.postcards.must_be_kind_of(Lob::Resources::Postcard)
|
39
35
|
end
|
40
36
|
|
41
|
-
it "should return routes resource" do
|
42
|
-
subject.routes.must_be_kind_of(Lob::Resources::Route)
|
43
|
-
end
|
44
|
-
|
45
37
|
it "should accept an idempotency_key" do
|
46
38
|
sample_address_params = {
|
47
39
|
name: "TestAddress",
|
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
|
+
version: 5.0.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-
|
11
|
+
date: 2018-07-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -177,14 +177,12 @@ files:
|
|
177
177
|
- lib/lob/errors/invalid_request_error.rb
|
178
178
|
- lib/lob/errors/lob_error.rb
|
179
179
|
- lib/lob/resources/address.rb
|
180
|
-
- lib/lob/resources/area.rb
|
181
180
|
- lib/lob/resources/bank_account.rb
|
182
181
|
- lib/lob/resources/check.rb
|
183
182
|
- lib/lob/resources/intl_verifications.rb
|
184
183
|
- lib/lob/resources/letter.rb
|
185
184
|
- lib/lob/resources/postcard.rb
|
186
185
|
- lib/lob/resources/resource_base.rb
|
187
|
-
- lib/lob/resources/route.rb
|
188
186
|
- lib/lob/resources/us_autocompletions.rb
|
189
187
|
- lib/lob/resources/us_verifications.rb
|
190
188
|
- lib/lob/resources/us_zip_lookups.rb
|
@@ -192,14 +190,12 @@ files:
|
|
192
190
|
- lob.gemspec
|
193
191
|
- spec/lob/errors/lob_error_spec.rb
|
194
192
|
- spec/lob/resources/address_spec.rb
|
195
|
-
- spec/lob/resources/area_spec.rb
|
196
193
|
- spec/lob/resources/bank_account_spec.rb
|
197
194
|
- spec/lob/resources/check_spec.rb
|
198
195
|
- spec/lob/resources/intl_verifications_spec.rb
|
199
196
|
- spec/lob/resources/letter_spec.rb
|
200
197
|
- spec/lob/resources/postcard_spec.rb
|
201
198
|
- spec/lob/resources/resource_base_spec.rb
|
202
|
-
- spec/lob/resources/route_spec.rb
|
203
199
|
- spec/lob/resources/us_autocompletions_spec.rb
|
204
200
|
- spec/lob/resources/us_verifications_spec.rb
|
205
201
|
- spec/lob/resources/us_zip_lookups_spec.rb
|
@@ -228,21 +224,19 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
224
|
version: '0'
|
229
225
|
requirements: []
|
230
226
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.
|
227
|
+
rubygems_version: 2.6.14
|
232
228
|
signing_key:
|
233
229
|
specification_version: 4
|
234
230
|
summary: Ruby wrapper for Lob.com API with ActiveRecord-style syntax
|
235
231
|
test_files:
|
236
232
|
- spec/lob/errors/lob_error_spec.rb
|
237
233
|
- spec/lob/resources/address_spec.rb
|
238
|
-
- spec/lob/resources/area_spec.rb
|
239
234
|
- spec/lob/resources/bank_account_spec.rb
|
240
235
|
- spec/lob/resources/check_spec.rb
|
241
236
|
- spec/lob/resources/intl_verifications_spec.rb
|
242
237
|
- spec/lob/resources/letter_spec.rb
|
243
238
|
- spec/lob/resources/postcard_spec.rb
|
244
239
|
- spec/lob/resources/resource_base_spec.rb
|
245
|
-
- spec/lob/resources/route_spec.rb
|
246
240
|
- spec/lob/resources/us_autocompletions_spec.rb
|
247
241
|
- spec/lob/resources/us_verifications_spec.rb
|
248
242
|
- spec/lob/resources/us_zip_lookups_spec.rb
|
data/lib/lob/resources/area.rb
DELETED
data/lib/lob/resources/route.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
require "lob/resources/resource_base"
|
2
|
-
|
3
|
-
module Lob
|
4
|
-
module Resources
|
5
|
-
class Route < Lob::Resources::ResourceBase
|
6
|
-
|
7
|
-
undef_method :create, :destroy
|
8
|
-
|
9
|
-
def initialize(config)
|
10
|
-
super(config)
|
11
|
-
@endpoint = "routes"
|
12
|
-
end
|
13
|
-
|
14
|
-
def list(options = {})
|
15
|
-
if options.is_a?(String)
|
16
|
-
request = {
|
17
|
-
method: :get,
|
18
|
-
url: resource_url(options)
|
19
|
-
}
|
20
|
-
else
|
21
|
-
request = {
|
22
|
-
method: :get,
|
23
|
-
url: endpoint_url,
|
24
|
-
query: options
|
25
|
-
}
|
26
|
-
end
|
27
|
-
|
28
|
-
submit request
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Lob::Resources::Area do
|
4
|
-
before :each do
|
5
|
-
@sample_area_params = {
|
6
|
-
description: "Test Area",
|
7
|
-
front: "https://s3-us-west-2.amazonaws.com/lob-assets/areafront.pdf",
|
8
|
-
back: "https://s3-us-west-2.amazonaws.com/lob-assets/areaback.pdf",
|
9
|
-
routes: ["94158-C001", "94107-C031"],
|
10
|
-
}
|
11
|
-
end
|
12
|
-
|
13
|
-
subject { Lob::Client.new(api_key: API_KEY) }
|
14
|
-
|
15
|
-
describe "list" do
|
16
|
-
it "should list areas" do
|
17
|
-
assert subject.areas.list["object"] == "list"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe "create" do
|
22
|
-
it "should create an area object" do
|
23
|
-
result = subject.areas.create @sample_area_params
|
24
|
-
|
25
|
-
result["object"].must_equal("area")
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should create an area object with optionals params" do
|
29
|
-
@sample_area_params[:target_type] = "all"
|
30
|
-
|
31
|
-
result = subject.areas.create @sample_area_params
|
32
|
-
|
33
|
-
result["description"].must_equal @sample_area_params[:description]
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should create an area object with a single route" do
|
37
|
-
@sample_area_params[:routes] = "94158-C001"
|
38
|
-
result = subject.areas.create @sample_area_params
|
39
|
-
|
40
|
-
result["object"].must_equal("area")
|
41
|
-
end
|
42
|
-
|
43
|
-
it "should create an area object with zip_codes" do
|
44
|
-
@sample_area_params[:routes] = ["94158"];
|
45
|
-
result = subject.areas.create @sample_area_params
|
46
|
-
|
47
|
-
result["object"].must_equal("area")
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
describe "find" do
|
52
|
-
it "should find an area" do
|
53
|
-
new_area = subject.areas.create @sample_area_params
|
54
|
-
|
55
|
-
result = subject.areas.find new_area["id"]
|
56
|
-
result["object"].must_equal("area")
|
57
|
-
end
|
58
|
-
end
|
59
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Lob::Resources::Route do
|
4
|
-
|
5
|
-
subject { Lob::Client.new(api_key: API_KEY) }
|
6
|
-
|
7
|
-
describe "find" do
|
8
|
-
|
9
|
-
it "should fetch a route" do
|
10
|
-
zip_code = "94158"
|
11
|
-
routes = subject.routes.find(zip_code)
|
12
|
-
routes["zip_code"].must_equal(zip_code)
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "list" do
|
18
|
-
|
19
|
-
it "should list routes" do
|
20
|
-
zip_code = "94158"
|
21
|
-
routes = subject.routes.list(zip_codes: zip_code)
|
22
|
-
routes["data"][0]["zip_code"].must_equal(zip_code)
|
23
|
-
end
|
24
|
-
|
25
|
-
it "should accept a single ZIP code as input" do
|
26
|
-
zip_code = "94158"
|
27
|
-
routes = subject.routes.list(zip_code)
|
28
|
-
routes["zip_code"].must_equal(zip_code)
|
29
|
-
end
|
30
|
-
|
31
|
-
it "should list routes given multiple zip codes" do
|
32
|
-
zip_codes = ["94107", "94158"]
|
33
|
-
routes = subject.routes.list(zip_codes: zip_codes)
|
34
|
-
routes["data"][0]["zip_code"].must_equal(zip_codes[0])
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|