lob 2.5.1 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -2
  3. data/CHANGELOG.md +9 -0
  4. data/CONTRIBUTING.md +19 -0
  5. data/Gemfile +0 -2
  6. data/README.md +19 -36
  7. data/examples/README.md +14 -6
  8. data/examples/checks.rb +6 -7
  9. data/examples/csv_checks/create_checks.rb +47 -0
  10. data/examples/csv_checks/input.csv +6 -0
  11. data/examples/csv_letters/create_letters.rb +40 -0
  12. data/examples/csv_letters/input.csv +6 -0
  13. data/examples/csv_letters/letter_template.html +33 -0
  14. data/examples/csv_postcards/create_postcards.rb +2 -3
  15. data/examples/letters.rb +4 -5
  16. data/examples/postcards.rb +4 -5
  17. data/examples/verify/verify.rb +3 -4
  18. data/lib/lob.rb +1 -91
  19. data/lib/lob/client.rb +61 -0
  20. data/lib/lob/resources/address.rb +24 -0
  21. data/lib/lob/resources/area.rb +16 -0
  22. data/lib/lob/resources/bank_account.rb +24 -0
  23. data/lib/lob/resources/check.rb +14 -0
  24. data/lib/lob/resources/country.rb +16 -0
  25. data/lib/lob/resources/letter.rb +14 -0
  26. data/lib/lob/resources/postcard.rb +14 -0
  27. data/lib/lob/resources/resource_base.rb +108 -0
  28. data/lib/lob/resources/route.rb +24 -0
  29. data/lib/lob/resources/state.rb +16 -0
  30. data/lib/lob/version.rb +1 -1
  31. data/spec/lob/{v1 → resources}/address_spec.rb +15 -14
  32. data/spec/lob/{v1 → resources}/area_spec.rb +2 -2
  33. data/spec/lob/{v1 → resources}/bank_account_spec.rb +2 -2
  34. data/spec/lob/{v1 → resources}/check_spec.rb +3 -2
  35. data/spec/lob/{v1 → resources}/country_spec.rb +2 -2
  36. data/spec/lob/{v1 → resources}/letter_spec.rb +2 -2
  37. data/spec/lob/{v1 → resources}/postcard_spec.rb +2 -2
  38. data/spec/lob/resources/resource_base_spec.rb +53 -0
  39. data/spec/lob/{v1 → resources}/route_spec.rb +2 -2
  40. data/spec/lob/{v1 → resources}/state_spec.rb +2 -2
  41. data/spec/lob_spec.rb +12 -45
  42. data/spec/spec_helper.rb +2 -0
  43. metadata +86 -89
  44. data/examples/jobs.rb +0 -91
  45. data/lib/lob/v1/address.rb +0 -41
  46. data/lib/lob/v1/area.rb +0 -27
  47. data/lib/lob/v1/bank_account.rb +0 -37
  48. data/lib/lob/v1/check.rb +0 -33
  49. data/lib/lob/v1/country.rb +0 -21
  50. data/lib/lob/v1/job.rb +0 -39
  51. data/lib/lob/v1/letter.rb +0 -33
  52. data/lib/lob/v1/object.rb +0 -33
  53. data/lib/lob/v1/postcard.rb +0 -33
  54. data/lib/lob/v1/resource.rb +0 -69
  55. data/lib/lob/v1/route.rb +0 -27
  56. data/lib/lob/v1/setting.rb +0 -25
  57. data/lib/lob/v1/state.rb +0 -21
  58. data/spec/lob/v1/job_spec.rb +0 -161
  59. data/spec/lob/v1/object_spec.rb +0 -72
  60. data/spec/lob/v1/resource_spec.rb +0 -41
  61. data/spec/lob/v1/setting_spec.rb +0 -21
@@ -0,0 +1,24 @@
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
+ submit :get, resource_url(options)
17
+ else
18
+ submit :get, endpoint_url, options
19
+ end
20
+ end
21
+
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,16 @@
1
+ require "lob/resources/resource_base"
2
+
3
+ module Lob
4
+ module Resources
5
+ class State < Lob::Resources::ResourceBase
6
+
7
+ undef_method :find, :create, :destroy
8
+
9
+ def initialize(config)
10
+ super(config)
11
+ @endpoint = "states"
12
+ end
13
+
14
+ end
15
+ end
16
+ end
data/lib/lob/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lob
2
- VERSION = "2.5.1"
2
+ VERSION = "3.0.0"
3
3
  end
@@ -1,9 +1,9 @@
1
1
  require "spec_helper"
2
2
 
3
- describe Lob::V1::Address do
3
+ describe Lob::Resources::Address do
4
4
 
5
- let(:sample_params) {
6
- {
5
+ before :each do
6
+ @sample_params = {
7
7
  name: "John Doe",
8
8
  address_line1: "325 Berry Street",
9
9
  address_city: "San Francisco",
@@ -14,18 +14,18 @@ describe Lob::V1::Address do
14
14
  test: 'stuff'
15
15
  }
16
16
  }
17
- }
17
+ end
18
18
 
19
- subject { Lob(api_key: ENV["LOB_API_KEY"]) }
19
+ subject { Lob::Client.new(api_key: API_KEY) }
20
20
 
21
21
  describe "verify" do
22
22
 
23
23
  it "should verify an address" do
24
24
  result = subject.addresses.verify(
25
- address_line1: sample_params[:address_line1],
26
- address_city: sample_params[:address_city],
27
- address_state: sample_params[:address_state],
28
- address_zip: sample_params[:address_zip]
25
+ address_line1: @sample_params[:address_line1],
26
+ address_city: @sample_params[:address_city],
27
+ address_state: @sample_params[:address_state],
28
+ address_zip: @sample_params[:address_zip]
29
29
  )
30
30
 
31
31
  result["address"]["address_country"].must_equal("US")
@@ -42,25 +42,26 @@ describe Lob::V1::Address do
42
42
 
43
43
  describe "create" do
44
44
  it "should create an address" do
45
- result = subject.addresses.create sample_params
46
- assert /#{result["name"]}/i =~ sample_params[:name]
45
+ result = subject.addresses.create @sample_params
46
+
47
+ result["name"].must_equal(@sample_params[:name])
47
48
  end
48
49
  end
49
50
 
50
51
 
51
52
  describe "find" do
52
53
  it "should find an address" do
53
- new_address = subject.addresses.create sample_params
54
+ new_address = subject.addresses.create @sample_params
54
55
 
55
56
  find_result = subject.addresses.find(new_address["id"])
56
- assert /#{find_result["name"]}/i =~ sample_params[:name]
57
+ find_result["name"].must_equal(@sample_params[:name])
57
58
  end
58
59
  end
59
60
 
60
61
 
61
62
  describe "destroy" do
62
63
  it "should delete an address" do
63
- new_address = subject.addresses.create sample_params
64
+ new_address = subject.addresses.create @sample_params
64
65
 
65
66
  delete_result = subject.addresses.destroy(new_address["id"])
66
67
  assert_equal(new_address["id"], delete_result["id"])
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe Lob::V1::Area do
3
+ describe Lob::Resources::Area do
4
4
  before :each do
5
5
  @sample_area_params = {
6
6
  description: "Test Area",
@@ -10,7 +10,7 @@ describe Lob::V1::Area do
10
10
  }
11
11
  end
12
12
 
13
- subject { Lob(api_key: ENV["LOB_API_KEY"]) }
13
+ subject { Lob::Client.new(api_key: API_KEY) }
14
14
 
15
15
  describe "list" do
16
16
  it "should list areas" do
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe Lob::V1::BankAccount do
3
+ describe Lob::Resources::BankAccount do
4
4
 
5
5
  before :each do
6
6
  @sample_bank_account_params = {
@@ -11,7 +11,7 @@ describe Lob::V1::BankAccount do
11
11
  }
12
12
  end
13
13
 
14
- subject { Lob(api_key: ENV["LOB_API_KEY"]) }
14
+ subject { Lob::Client.new(api_key: API_KEY) }
15
15
 
16
16
  describe "list" do
17
17
  it "should list bank accounts" do
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe Lob::V1::Check do
3
+ describe Lob::Resources::Check do
4
4
 
5
5
  before :each do
6
6
 
@@ -21,9 +21,10 @@ describe Lob::V1::Check do
21
21
  account_type: "company",
22
22
  signatory: "John Doe"
23
23
  }
24
+
24
25
  end
25
26
 
26
- subject { Lob(api_key: ENV["LOB_API_KEY"]) }
27
+ subject { Lob::Client.new(api_key: API_KEY) }
27
28
 
28
29
  describe "list" do
29
30
  it "should list checks" do
@@ -1,8 +1,8 @@
1
1
  require "spec_helper"
2
2
 
3
- describe Lob::V1::Country do
3
+ describe Lob::Resources::Country do
4
4
 
5
- subject { Lob(api_key: ENV["LOB_API_KEY"]) }
5
+ subject { Lob::Client.new(api_key: API_KEY) }
6
6
 
7
7
  describe "list" do
8
8
  it "should list countries" do
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe Lob::V1::Letter do
3
+ describe Lob::Resources::Letter do
4
4
 
5
5
  before :each do
6
6
  @sample_address_params = {
@@ -15,7 +15,7 @@ describe Lob::V1::Letter do
15
15
  }
16
16
  end
17
17
 
18
- subject { Lob(api_key: ENV["LOB_API_KEY"]) }
18
+ subject { Lob::Client.new(api_key: API_KEY) }
19
19
 
20
20
  describe "list" do
21
21
  it "should list letter" do
@@ -1,6 +1,6 @@
1
1
  require "spec_helper"
2
2
 
3
- describe Lob::V1::Postcard do
3
+ describe Lob::Resources::Postcard do
4
4
 
5
5
  before :each do
6
6
  @sample_address_params = {
@@ -20,7 +20,7 @@ describe Lob::V1::Postcard do
20
20
  }
21
21
  end
22
22
 
23
- subject { Lob(api_key: ENV["LOB_API_KEY"]) }
23
+ subject { Lob::Client.new(api_key: API_KEY) }
24
24
 
25
25
  describe "list" do
26
26
  it "should list postcards" do
@@ -0,0 +1,53 @@
1
+ require "spec_helper"
2
+
3
+ describe Lob::Resources::ResourceBase do
4
+
5
+ before :each do
6
+ @api_key = "test"
7
+ end
8
+
9
+ subject { Lob::Client.new(api_key: @api_key) }
10
+
11
+ describe "when Lob is initialized" do
12
+ it "should have API key in config" do
13
+ subject.config[:api_key].must_equal @api_key
14
+ end
15
+ end
16
+
17
+ it "should return areas resource" do
18
+ subject.areas.must_be_kind_of(Lob::Resources::Area)
19
+ end
20
+
21
+ it "should return addresses resource" do
22
+ subject.addresses.must_be_kind_of(Lob::Resources::Address)
23
+ end
24
+
25
+ it "should return bank accounts resource" do
26
+ subject.bank_accounts.must_be_kind_of(Lob::Resources::BankAccount)
27
+ end
28
+
29
+ it "should return checks resource" do
30
+ subject.checks.must_be_kind_of(Lob::Resources::Check)
31
+ end
32
+
33
+ it "should return countries resource" do
34
+ subject.countries.must_be_kind_of(Lob::Resources::Country)
35
+ end
36
+
37
+ it "should return letters resource" do
38
+ subject.letters.must_be_kind_of(Lob::Resources::Letter)
39
+ end
40
+
41
+ it "should return postcards resource" do
42
+ subject.postcards.must_be_kind_of(Lob::Resources::Postcard)
43
+ end
44
+
45
+ it "should return routes resource" do
46
+ subject.routes.must_be_kind_of(Lob::Resources::Route)
47
+ end
48
+
49
+ it "should return states resource" do
50
+ subject.states.must_be_kind_of(Lob::Resources::State)
51
+ end
52
+
53
+ end
@@ -1,8 +1,8 @@
1
1
  require "spec_helper"
2
2
 
3
- describe Lob::V1::Route do
3
+ describe Lob::Resources::Route do
4
4
 
5
- subject { Lob(api_key: ENV["LOB_API_KEY"]) }
5
+ subject { Lob::Client.new(api_key: API_KEY) }
6
6
 
7
7
  describe "find" do
8
8
 
@@ -1,8 +1,8 @@
1
1
  require "spec_helper"
2
2
 
3
- describe Lob::V1::State do
3
+ describe Lob::Resources::State do
4
4
 
5
- subject { Lob(api_key: ENV["LOB_API_KEY"]) }
5
+ subject { Lob::Client.new(api_key: API_KEY) }
6
6
 
7
7
  describe "list" do
8
8
  it "should list states" do
data/spec/lob_spec.rb CHANGED
@@ -2,77 +2,44 @@ require "spec_helper"
2
2
 
3
3
  describe Lob do
4
4
 
5
- after do
6
- Lob.api_key = nil
7
- Lob.api_version = nil
8
- end
9
-
10
- it "should return the resource object for the valid version" do
11
- Lob(api_key: "test", api_version: "2014-11-25").must_be_kind_of(Lob::V1::Resource)
12
- end
13
-
14
- it "should *not* raise an error if API key has been on module and not passed as option" do
15
- Lob.api_key = "test"
16
- Lob().wont_be_nil
5
+ it "should return the client object for the valid version" do
6
+ lob = Lob::Client.new(api_key: "test", api_version: "2014-11-25")
7
+ lob.must_be_kind_of(Lob::Client)
8
+ assert lob.config[:api_version] == "2014-11-25"
17
9
  end
18
10
 
19
11
  it "should pass the API key to the resource for the version" do
20
- Lob(api_key: "test").options[:api_key].must_equal "test"
12
+ Lob::Client.new(api_key: "test").config[:api_key].must_equal "test"
21
13
  end
22
14
 
23
15
  it "should raise an error if no API key is supplied" do
24
16
  assert_raises ArgumentError do
25
- Lob()
26
- end
27
- end
28
-
29
- it "should allow detailed configuration" do
30
- Lob.configure do |config|
31
- config.api_key = "test"
32
- config.api_version = "2014-11-24"
33
- config.protocol = "https"
34
- config.api_host = "api.lob.com"
17
+ Lob::Client.new()
35
18
  end
36
-
37
- Lob.api_key.must_equal "test"
38
- Lob.api_version.must_equal "2014-11-24"
39
- Lob.protocol.must_equal "https"
40
- Lob.api_host.must_equal "api.lob.com"
41
- end
42
-
43
- it "should work with Lob.load" do
44
- Lob.load(api_key: "test").options[:api_key].must_equal "test"
45
-
46
- Lob.api_key = "test"
47
- Lob.load.wont_be_nil
48
-
49
- Lob.load(api_key: "test").must_be_kind_of(Lob::V1::Resource)
50
19
  end
51
20
 
52
21
  it "should handle API errors gracefully" do
53
- lob = Lob.load(api_key: ENV["LOB_API_KEY"])
22
+ lob = Lob::Client.new(api_key: API_KEY)
54
23
  assert_raises Lob::InvalidRequestError do
55
- lob.objects.create(name: "Test", file: "https://lob.com/test.pdf", bad_param: "bad_value")
24
+ lob.postcards.create(name: "Test", file: "https://lob.com/test.pdf", bad_param: "bad_value")
56
25
  end
57
26
  end
58
27
 
59
28
  it "should work when no api_version is provided" do
60
- lob = Lob.load(api_key: ENV["LOB_API_KEY"])
61
- Lob.api_version = nil
29
+ lob = Lob::Client.new(api_key: API_KEY)
62
30
  lob.addresses.list
63
- Lob.api_version = "2014-11-24"
64
31
  end
65
32
 
66
33
  it "should include the raw response" do
67
- lob = Lob.load(api_key: ENV["LOB_API_KEY"])
34
+ lob = Lob::Client.new(api_key: API_KEY)
68
35
  result = lob.addresses.list
69
36
  assert result._response.headers.include?(:content_type)
70
37
  end
71
38
 
72
39
  it "should include response headers for errors" do
73
- lob = Lob.load(api_key: ENV["LOB_API_KEY"])
40
+ lob = Lob::Client.new(api_key: API_KEY)
74
41
  begin
75
- lob.objects.create(name: "Test", file: "https://lob.com/test.pdf", bad_param: "bad_value")
42
+ lob.postcards.create(bad_param: "bad_value")
76
43
  rescue Lob::InvalidRequestError => e
77
44
  assert e._response.headers.include?(:content_type)
78
45
  end
data/spec/spec_helper.rb CHANGED
@@ -13,3 +13,5 @@ require "lob"
13
13
  require "minitest/spec"
14
14
  require "minitest/pride"
15
15
  require "minitest/autorun"
16
+
17
+ API_KEY = 'test_799ff27291c166d10ba191902ad02fb059c'
metadata CHANGED
@@ -1,145 +1,145 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lob
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.1
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lob
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-07-27 00:00:00.000000000 Z
11
+ date: 2016-10-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
+ name: rest-client
14
15
  requirement: !ruby/object:Gem::Requirement
15
16
  requirements:
16
- - - '>='
17
+ - - ">="
17
18
  - !ruby/object:Gem::Version
18
19
  version: '1.8'
19
- - - <
20
+ - - "<"
20
21
  - !ruby/object:Gem::Version
21
22
  version: '3.0'
22
- name: rest-client
23
- prerelease: false
24
23
  type: :runtime
24
+ prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: '1.8'
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '3.0'
33
33
  - !ruby/object:Gem::Dependency
34
+ name: bundler
34
35
  requirement: !ruby/object:Gem::Requirement
35
36
  requirements:
36
- - - ~>
37
+ - - "~>"
37
38
  - !ruby/object:Gem::Version
38
39
  version: '1.3'
39
- name: bundler
40
- prerelease: false
41
40
  type: :development
41
+ prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
43
43
  requirements:
44
- - - ~>
44
+ - - "~>"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '1.3'
47
47
  - !ruby/object:Gem::Dependency
48
+ name: rake
48
49
  requirement: !ruby/object:Gem::Requirement
49
50
  requirements:
50
- - - ~>
51
+ - - "~>"
51
52
  - !ruby/object:Gem::Version
52
53
  version: 10.4.2
53
- name: rake
54
- prerelease: false
55
54
  type: :development
55
+ prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ~>
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: 10.4.2
61
61
  - !ruby/object:Gem::Dependency
62
+ name: minitest
62
63
  requirement: !ruby/object:Gem::Requirement
63
64
  requirements:
64
- - - ~>
65
+ - - "~>"
65
66
  - !ruby/object:Gem::Version
66
67
  version: 5.6.1
67
- name: minitest
68
- prerelease: false
69
68
  type: :development
69
+ prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ~>
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: 5.6.1
75
75
  - !ruby/object:Gem::Dependency
76
+ name: webmock
76
77
  requirement: !ruby/object:Gem::Requirement
77
78
  requirements:
78
- - - ~>
79
+ - - "~>"
79
80
  - !ruby/object:Gem::Version
80
81
  version: '1.2'
81
- name: webmock
82
- prerelease: false
83
82
  type: :development
83
+ prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ~>
86
+ - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '1.2'
89
89
  - !ruby/object:Gem::Dependency
90
+ name: travis-lint
90
91
  requirement: !ruby/object:Gem::Requirement
91
92
  requirements:
92
- - - ~>
93
+ - - "~>"
93
94
  - !ruby/object:Gem::Version
94
95
  version: 2.0.0
95
- name: travis-lint
96
- prerelease: false
97
96
  type: :development
97
+ prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
- - - ~>
100
+ - - "~>"
101
101
  - !ruby/object:Gem::Version
102
102
  version: 2.0.0
103
103
  - !ruby/object:Gem::Dependency
104
+ name: coveralls
104
105
  requirement: !ruby/object:Gem::Requirement
105
106
  requirements:
106
- - - ~>
107
+ - - "~>"
107
108
  - !ruby/object:Gem::Version
108
109
  version: 0.8.1
109
- name: coveralls
110
- prerelease: false
111
110
  type: :development
111
+ prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
- - - ~>
114
+ - - "~>"
115
115
  - !ruby/object:Gem::Version
116
116
  version: 0.8.1
117
117
  - !ruby/object:Gem::Dependency
118
+ name: simplecov
118
119
  requirement: !ruby/object:Gem::Requirement
119
120
  requirements:
120
- - - ~>
121
+ - - "~>"
121
122
  - !ruby/object:Gem::Version
122
123
  version: 0.10.0
123
- name: simplecov
124
- prerelease: false
125
124
  type: :development
125
+ prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - ~>
128
+ - - "~>"
129
129
  - !ruby/object:Gem::Version
130
130
  version: 0.10.0
131
131
  - !ruby/object:Gem::Dependency
132
+ name: pry
132
133
  requirement: !ruby/object:Gem::Requirement
133
134
  requirements:
134
- - - ~>
135
+ - - "~>"
135
136
  - !ruby/object:Gem::Version
136
137
  version: 0.10.0
137
- name: pry
138
- prerelease: false
139
138
  type: :development
139
+ prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - ~>
142
+ - - "~>"
143
143
  - !ruby/object:Gem::Version
144
144
  version: 0.10.0
145
145
  description: Lob API Ruby wrapper
@@ -149,56 +149,56 @@ executables: []
149
149
  extensions: []
150
150
  extra_rdoc_files: []
151
151
  files:
152
- - .gitignore
153
- - .travis.yml
152
+ - ".gitignore"
153
+ - ".travis.yml"
154
154
  - CHANGELOG.md
155
+ - CONTRIBUTING.md
155
156
  - Gemfile
156
157
  - LICENSE.txt
157
158
  - README.md
158
159
  - Rakefile
159
160
  - examples/README.md
160
161
  - examples/checks.rb
162
+ - examples/csv_checks/create_checks.rb
163
+ - examples/csv_checks/input.csv
164
+ - examples/csv_letters/create_letters.rb
165
+ - examples/csv_letters/input.csv
166
+ - examples/csv_letters/letter_template.html
161
167
  - examples/csv_postcards/create_postcards.rb
162
168
  - examples/csv_postcards/input.csv
163
169
  - examples/csv_postcards/postcard_back.html
164
170
  - examples/csv_postcards/postcard_front.html
165
- - examples/jobs.rb
166
171
  - examples/letters.rb
167
172
  - examples/postcards.rb
168
173
  - examples/verify/input.txt
169
174
  - examples/verify/verify.rb
170
175
  - lib/lob.rb
176
+ - lib/lob/client.rb
171
177
  - lib/lob/errors/invalid_request_error.rb
172
178
  - lib/lob/errors/lob_error.rb
173
- - lib/lob/v1/address.rb
174
- - lib/lob/v1/area.rb
175
- - lib/lob/v1/bank_account.rb
176
- - lib/lob/v1/check.rb
177
- - lib/lob/v1/country.rb
178
- - lib/lob/v1/job.rb
179
- - lib/lob/v1/letter.rb
180
- - lib/lob/v1/object.rb
181
- - lib/lob/v1/postcard.rb
182
- - lib/lob/v1/resource.rb
183
- - lib/lob/v1/route.rb
184
- - lib/lob/v1/setting.rb
185
- - lib/lob/v1/state.rb
179
+ - lib/lob/resources/address.rb
180
+ - lib/lob/resources/area.rb
181
+ - lib/lob/resources/bank_account.rb
182
+ - lib/lob/resources/check.rb
183
+ - lib/lob/resources/country.rb
184
+ - lib/lob/resources/letter.rb
185
+ - lib/lob/resources/postcard.rb
186
+ - lib/lob/resources/resource_base.rb
187
+ - lib/lob/resources/route.rb
188
+ - lib/lob/resources/state.rb
186
189
  - lib/lob/version.rb
187
190
  - lob.gemspec
188
191
  - spec/lob/errors/lob_error_spec.rb
189
- - spec/lob/v1/address_spec.rb
190
- - spec/lob/v1/area_spec.rb
191
- - spec/lob/v1/bank_account_spec.rb
192
- - spec/lob/v1/check_spec.rb
193
- - spec/lob/v1/country_spec.rb
194
- - spec/lob/v1/job_spec.rb
195
- - spec/lob/v1/letter_spec.rb
196
- - spec/lob/v1/object_spec.rb
197
- - spec/lob/v1/postcard_spec.rb
198
- - spec/lob/v1/resource_spec.rb
199
- - spec/lob/v1/route_spec.rb
200
- - spec/lob/v1/setting_spec.rb
201
- - spec/lob/v1/state_spec.rb
192
+ - spec/lob/resources/address_spec.rb
193
+ - spec/lob/resources/area_spec.rb
194
+ - spec/lob/resources/bank_account_spec.rb
195
+ - spec/lob/resources/check_spec.rb
196
+ - spec/lob/resources/country_spec.rb
197
+ - spec/lob/resources/letter_spec.rb
198
+ - spec/lob/resources/postcard_spec.rb
199
+ - spec/lob/resources/resource_base_spec.rb
200
+ - spec/lob/resources/route_spec.rb
201
+ - spec/lob/resources/state_spec.rb
202
202
  - spec/lob_spec.rb
203
203
  - spec/samples/8.5x11.pdf
204
204
  - spec/samples/postcardback.pdf
@@ -208,41 +208,38 @@ homepage: https://github.com/lob/lob-ruby
208
208
  licenses:
209
209
  - MIT
210
210
  metadata: {}
211
- post_install_message:
211
+ post_install_message:
212
212
  rdoc_options: []
213
213
  require_paths:
214
214
  - lib
215
215
  required_ruby_version: !ruby/object:Gem::Requirement
216
216
  requirements:
217
- - - '>='
217
+ - - ">="
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  required_rubygems_version: !ruby/object:Gem::Requirement
221
221
  requirements:
222
- - - '>='
222
+ - - ">="
223
223
  - !ruby/object:Gem::Version
224
224
  version: '0'
225
225
  requirements: []
226
- rubyforge_project:
227
- rubygems_version: 2.4.5
228
- signing_key:
226
+ rubyforge_project:
227
+ rubygems_version: 2.6.6
228
+ signing_key:
229
229
  specification_version: 4
230
230
  summary: Ruby wrapper for Lob.com API with ActiveRecord-style syntax
231
231
  test_files:
232
232
  - spec/lob/errors/lob_error_spec.rb
233
- - spec/lob/v1/address_spec.rb
234
- - spec/lob/v1/area_spec.rb
235
- - spec/lob/v1/bank_account_spec.rb
236
- - spec/lob/v1/check_spec.rb
237
- - spec/lob/v1/country_spec.rb
238
- - spec/lob/v1/job_spec.rb
239
- - spec/lob/v1/letter_spec.rb
240
- - spec/lob/v1/object_spec.rb
241
- - spec/lob/v1/postcard_spec.rb
242
- - spec/lob/v1/resource_spec.rb
243
- - spec/lob/v1/route_spec.rb
244
- - spec/lob/v1/setting_spec.rb
245
- - spec/lob/v1/state_spec.rb
233
+ - spec/lob/resources/address_spec.rb
234
+ - spec/lob/resources/area_spec.rb
235
+ - spec/lob/resources/bank_account_spec.rb
236
+ - spec/lob/resources/check_spec.rb
237
+ - spec/lob/resources/country_spec.rb
238
+ - spec/lob/resources/letter_spec.rb
239
+ - spec/lob/resources/postcard_spec.rb
240
+ - spec/lob/resources/resource_base_spec.rb
241
+ - spec/lob/resources/route_spec.rb
242
+ - spec/lob/resources/state_spec.rb
246
243
  - spec/lob_spec.rb
247
244
  - spec/samples/8.5x11.pdf
248
245
  - spec/samples/postcardback.pdf