smartystreets_ruby_sdk 2.0.2 → 3.0.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 +4 -4
- data/Makefile +1 -1
- data/Vagrantfile +4 -2
- data/examples/international_example.rb +31 -0
- data/examples/us_autocomplete_example.rb +38 -0
- data/examples/us_extract_example.rb +52 -0
- data/examples/us_street_multiple_address_example.rb +11 -9
- data/examples/us_street_single_address_example.rb +3 -3
- data/examples/us_zipcode_multiple_lookup_example.rb +7 -5
- data/examples/us_zipcode_single_lookup_example.rb +3 -3
- data/lib/smartystreets_ruby_sdk/batch.rb +7 -3
- data/lib/smartystreets_ruby_sdk/client_builder.rb +118 -0
- data/lib/smartystreets_ruby_sdk/errors.rb +15 -7
- data/lib/smartystreets_ruby_sdk/exceptions.rb +12 -5
- data/lib/smartystreets_ruby_sdk/international_street.rb +10 -0
- data/lib/smartystreets_ruby_sdk/international_street/analysis.rb +13 -0
- data/lib/smartystreets_ruby_sdk/international_street/candidate.rb +33 -0
- data/lib/smartystreets_ruby_sdk/international_street/client.rb +56 -0
- data/lib/smartystreets_ruby_sdk/international_street/components.rb +55 -0
- data/lib/smartystreets_ruby_sdk/international_street/language_mode.rb +5 -0
- data/lib/smartystreets_ruby_sdk/international_street/lookup.rb +80 -0
- data/lib/smartystreets_ruby_sdk/international_street/metadata.rb +14 -0
- data/lib/smartystreets_ruby_sdk/json_able.rb +3 -3
- data/lib/smartystreets_ruby_sdk/native_sender.rb +6 -2
- data/lib/smartystreets_ruby_sdk/request.rb +2 -1
- data/lib/smartystreets_ruby_sdk/retry_sender.rb +5 -7
- data/lib/smartystreets_ruby_sdk/us_autocomplete.rb +7 -0
- data/lib/smartystreets_ruby_sdk/us_autocomplete/client.rb +66 -0
- data/lib/smartystreets_ruby_sdk/us_autocomplete/geolocation_type.rb +5 -0
- data/lib/smartystreets_ruby_sdk/us_autocomplete/lookup.rb +34 -0
- data/lib/smartystreets_ruby_sdk/us_autocomplete/suggestion.rb +14 -0
- data/lib/smartystreets_ruby_sdk/us_extract.rb +8 -0
- data/lib/smartystreets_ruby_sdk/us_extract/address.rb +22 -0
- data/lib/smartystreets_ruby_sdk/us_extract/client.rb +46 -0
- data/lib/smartystreets_ruby_sdk/us_extract/lookup.rb +20 -0
- data/lib/smartystreets_ruby_sdk/us_extract/metadata.rb +15 -0
- data/lib/smartystreets_ruby_sdk/us_extract/result.rb +19 -0
- data/lib/smartystreets_ruby_sdk/us_street.rb +1 -1
- data/lib/smartystreets_ruby_sdk/us_street/analysis.rb +1 -0
- data/lib/smartystreets_ruby_sdk/us_street/candidate.rb +1 -0
- data/lib/smartystreets_ruby_sdk/us_street/client.rb +9 -5
- data/lib/smartystreets_ruby_sdk/us_street/components.rb +3 -0
- data/lib/smartystreets_ruby_sdk/us_street/lookup.rb +6 -0
- data/lib/smartystreets_ruby_sdk/us_street/match_type.rb +5 -0
- data/lib/smartystreets_ruby_sdk/us_street/metadata.rb +1 -0
- data/lib/smartystreets_ruby_sdk/us_zipcode.rb +1 -1
- data/lib/smartystreets_ruby_sdk/us_zipcode/alternate_county.rb +13 -0
- data/lib/smartystreets_ruby_sdk/us_zipcode/city.rb +2 -0
- data/lib/smartystreets_ruby_sdk/us_zipcode/client.rb +12 -4
- data/lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb +4 -0
- data/lib/smartystreets_ruby_sdk/us_zipcode/result.rb +3 -2
- data/lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb +16 -3
- data/lib/smartystreets_ruby_sdk/version.rb +1 -1
- metadata +28 -7
- data/lib/smartystreets_ruby_sdk/core_client_builder.rb +0 -57
- data/lib/smartystreets_ruby_sdk/match_type.rb +0 -5
- data/lib/smartystreets_ruby_sdk/us_street/client_builder.rb +0 -15
- data/lib/smartystreets_ruby_sdk/us_zipcode/client_builder.rb +0 -15
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: smartystreets_ruby_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SmartyStreets SDK Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -88,19 +88,29 @@ files:
|
|
88
88
|
- Vagrantfile
|
89
89
|
- bin/console
|
90
90
|
- bin/setup
|
91
|
+
- examples/international_example.rb
|
92
|
+
- examples/us_autocomplete_example.rb
|
93
|
+
- examples/us_extract_example.rb
|
91
94
|
- examples/us_street_multiple_address_example.rb
|
92
95
|
- examples/us_street_single_address_example.rb
|
93
96
|
- examples/us_zipcode_multiple_lookup_example.rb
|
94
97
|
- examples/us_zipcode_single_lookup_example.rb
|
95
98
|
- lib/smartystreets_ruby_sdk.rb
|
96
99
|
- lib/smartystreets_ruby_sdk/batch.rb
|
97
|
-
- lib/smartystreets_ruby_sdk/
|
100
|
+
- lib/smartystreets_ruby_sdk/client_builder.rb
|
98
101
|
- lib/smartystreets_ruby_sdk/custom_header_sender.rb
|
99
102
|
- lib/smartystreets_ruby_sdk/errors.rb
|
100
103
|
- lib/smartystreets_ruby_sdk/exceptions.rb
|
104
|
+
- lib/smartystreets_ruby_sdk/international_street.rb
|
105
|
+
- lib/smartystreets_ruby_sdk/international_street/analysis.rb
|
106
|
+
- lib/smartystreets_ruby_sdk/international_street/candidate.rb
|
107
|
+
- lib/smartystreets_ruby_sdk/international_street/client.rb
|
108
|
+
- lib/smartystreets_ruby_sdk/international_street/components.rb
|
109
|
+
- lib/smartystreets_ruby_sdk/international_street/language_mode.rb
|
110
|
+
- lib/smartystreets_ruby_sdk/international_street/lookup.rb
|
111
|
+
- lib/smartystreets_ruby_sdk/international_street/metadata.rb
|
101
112
|
- lib/smartystreets_ruby_sdk/json_able.rb
|
102
113
|
- lib/smartystreets_ruby_sdk/logger.rb
|
103
|
-
- lib/smartystreets_ruby_sdk/match_type.rb
|
104
114
|
- lib/smartystreets_ruby_sdk/native_sender.rb
|
105
115
|
- lib/smartystreets_ruby_sdk/native_serializer.rb
|
106
116
|
- lib/smartystreets_ruby_sdk/request.rb
|
@@ -112,18 +122,29 @@ files:
|
|
112
122
|
- lib/smartystreets_ruby_sdk/static_credentials.rb
|
113
123
|
- lib/smartystreets_ruby_sdk/status_code_sender.rb
|
114
124
|
- lib/smartystreets_ruby_sdk/url_prefix_sender.rb
|
125
|
+
- lib/smartystreets_ruby_sdk/us_autocomplete.rb
|
126
|
+
- lib/smartystreets_ruby_sdk/us_autocomplete/client.rb
|
127
|
+
- lib/smartystreets_ruby_sdk/us_autocomplete/geolocation_type.rb
|
128
|
+
- lib/smartystreets_ruby_sdk/us_autocomplete/lookup.rb
|
129
|
+
- lib/smartystreets_ruby_sdk/us_autocomplete/suggestion.rb
|
130
|
+
- lib/smartystreets_ruby_sdk/us_extract.rb
|
131
|
+
- lib/smartystreets_ruby_sdk/us_extract/address.rb
|
132
|
+
- lib/smartystreets_ruby_sdk/us_extract/client.rb
|
133
|
+
- lib/smartystreets_ruby_sdk/us_extract/lookup.rb
|
134
|
+
- lib/smartystreets_ruby_sdk/us_extract/metadata.rb
|
135
|
+
- lib/smartystreets_ruby_sdk/us_extract/result.rb
|
115
136
|
- lib/smartystreets_ruby_sdk/us_street.rb
|
116
137
|
- lib/smartystreets_ruby_sdk/us_street/analysis.rb
|
117
138
|
- lib/smartystreets_ruby_sdk/us_street/candidate.rb
|
118
139
|
- lib/smartystreets_ruby_sdk/us_street/client.rb
|
119
|
-
- lib/smartystreets_ruby_sdk/us_street/client_builder.rb
|
120
140
|
- lib/smartystreets_ruby_sdk/us_street/components.rb
|
121
141
|
- lib/smartystreets_ruby_sdk/us_street/lookup.rb
|
142
|
+
- lib/smartystreets_ruby_sdk/us_street/match_type.rb
|
122
143
|
- lib/smartystreets_ruby_sdk/us_street/metadata.rb
|
123
144
|
- lib/smartystreets_ruby_sdk/us_zipcode.rb
|
145
|
+
- lib/smartystreets_ruby_sdk/us_zipcode/alternate_county.rb
|
124
146
|
- lib/smartystreets_ruby_sdk/us_zipcode/city.rb
|
125
147
|
- lib/smartystreets_ruby_sdk/us_zipcode/client.rb
|
126
|
-
- lib/smartystreets_ruby_sdk/us_zipcode/client_builder.rb
|
127
148
|
- lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb
|
128
149
|
- lib/smartystreets_ruby_sdk/us_zipcode/result.rb
|
129
150
|
- lib/smartystreets_ruby_sdk/us_zipcode/zip_code.rb
|
@@ -149,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
149
170
|
version: '0'
|
150
171
|
requirements: []
|
151
172
|
rubyforge_project:
|
152
|
-
rubygems_version: 2.
|
173
|
+
rubygems_version: 2.5.1
|
153
174
|
signing_key:
|
154
175
|
specification_version: 4
|
155
176
|
summary: An official library for the SmartyStreets APIs
|
@@ -1,57 +0,0 @@
|
|
1
|
-
require_relative 'native_serializer'
|
2
|
-
require_relative 'native_sender'
|
3
|
-
require_relative 'status_code_sender'
|
4
|
-
require_relative 'signing_sender'
|
5
|
-
require_relative 'retry_sender'
|
6
|
-
require_relative 'url_prefix_sender'
|
7
|
-
require_relative 'sleeper'
|
8
|
-
require_relative 'logger'
|
9
|
-
|
10
|
-
class CoreClientBuilder
|
11
|
-
def initialize(signer)
|
12
|
-
@signer = signer
|
13
|
-
@serializer = NativeSerializer.new
|
14
|
-
@http_sender = nil
|
15
|
-
@max_retries = 5
|
16
|
-
@max_timeout = 10000
|
17
|
-
@url_prefix = ''
|
18
|
-
end
|
19
|
-
|
20
|
-
def retry_at_most(max_retries)
|
21
|
-
@max_retries = max_retries
|
22
|
-
self
|
23
|
-
end
|
24
|
-
|
25
|
-
def with_max_timeout(max_timeout)
|
26
|
-
@max_timeout = max_timeout
|
27
|
-
self
|
28
|
-
end
|
29
|
-
|
30
|
-
def with_serializer(serializer)
|
31
|
-
@serializer = serializer
|
32
|
-
self
|
33
|
-
end
|
34
|
-
|
35
|
-
def with_url(url_prefix)
|
36
|
-
@url_prefix = url_prefix
|
37
|
-
self
|
38
|
-
end
|
39
|
-
|
40
|
-
def build
|
41
|
-
# Implemented in child classes
|
42
|
-
end
|
43
|
-
|
44
|
-
def build_sender
|
45
|
-
return @http_sender if @http_sender != nil
|
46
|
-
|
47
|
-
sender = NativeSender.new(@max_timeout)
|
48
|
-
|
49
|
-
sender = StatusCodeSender.new(sender)
|
50
|
-
|
51
|
-
sender = SigningSender.new(@signer, sender) if @signer != nil
|
52
|
-
|
53
|
-
sender = RetrySender.new(@max_retries, sender, SmartystreetsRubySdk::Sleeper.new, SmartystreetsRubySdk::Logger.new) if @max_retries > 0
|
54
|
-
|
55
|
-
URLPrefixSender.new(@url_prefix, sender)
|
56
|
-
end
|
57
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require_relative '../core_client_builder'
|
2
|
-
require_relative 'client'
|
3
|
-
|
4
|
-
module USStreet
|
5
|
-
class ClientBuilder < CoreClientBuilder
|
6
|
-
def initialize(signer)
|
7
|
-
super(signer)
|
8
|
-
@url_prefix = 'https://us-street.api.smartystreets.com/street-address'
|
9
|
-
end
|
10
|
-
|
11
|
-
def build
|
12
|
-
Client.new(build_sender, @serializer)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require_relative '../core_client_builder'
|
2
|
-
require_relative 'client'
|
3
|
-
|
4
|
-
module USZipcode
|
5
|
-
class ClientBuilder < CoreClientBuilder
|
6
|
-
def initialize(signer)
|
7
|
-
super(signer)
|
8
|
-
@url_prefix = 'https://us-zipcode.api.smartystreets.com/lookup'
|
9
|
-
end
|
10
|
-
|
11
|
-
def build
|
12
|
-
Client.new(build_sender, @serializer)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|