smartystreets_ruby_sdk 7.2.3 → 7.4.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/examples/international_autocomplete_example.rb +3 -1
- data/lib/smartystreets_ruby_sdk/client_builder.rb +9 -4
- data/lib/smartystreets_ruby_sdk/international_autocomplete/client.rb +2 -0
- data/lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb +4 -2
- data/lib/smartystreets_ruby_sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b60b58e8728cb7cd3f9a9170df27c24152fc7d02ab4af4a179bad61b7eba03fe
|
|
4
|
+
data.tar.gz: f6745a6b43868516a748da2a8a78bdea8d0df8ed34b9cfa9038fb727aba72808
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d6899d2df0ee275c95e27ee67cc9893a9139723dfb69fe7645f79745633723611cd79f910f4d814824296e12d6e6a09ba59f09f4bcdc12bce2287324dab39b98
|
|
7
|
+
data.tar.gz: a4dcfd747d402177ef67d927655fb5ba553a3c36a26cd0e780a56144fbe5115ffb47819a2366bd91bb89a1ca844a24e1a4cf9c8a95b95f387d0b6f7f308ea6f1
|
|
@@ -28,13 +28,15 @@ class InternationalAutocompleteExample
|
|
|
28
28
|
lookup = Lookup.new('Louis')
|
|
29
29
|
lookup.country = "FRA"
|
|
30
30
|
lookup.locality = "Paris"
|
|
31
|
+
lookup.max_group_results = 5
|
|
32
|
+
lookup.geolocation = true
|
|
31
33
|
|
|
32
34
|
# lookup.add_custom_parameter('parameter', 'value')
|
|
33
35
|
|
|
34
36
|
suggestions = client.send(lookup) # The client will also return the suggestions directly
|
|
35
37
|
|
|
36
38
|
puts
|
|
37
|
-
puts '*** Result with some filters ***'
|
|
39
|
+
puts '*** Result with some filters (max_group_results=5, geolocation=on) ***'
|
|
38
40
|
puts
|
|
39
41
|
|
|
40
42
|
suggestions.each do |suggestion|
|
|
@@ -66,7 +66,7 @@ module SmartyStreets
|
|
|
66
66
|
self
|
|
67
67
|
end
|
|
68
68
|
|
|
69
|
-
#
|
|
69
|
+
# Sets the innermost HTTP transport sender while keeping the full middleware chain intact.
|
|
70
70
|
#
|
|
71
71
|
# Returns self to accommodate method chaining.
|
|
72
72
|
def with_sender(sender)
|
|
@@ -218,9 +218,14 @@ module SmartyStreets
|
|
|
218
218
|
# </editor-fold>
|
|
219
219
|
|
|
220
220
|
def build_sender
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
221
|
+
if @http_sender
|
|
222
|
+
conflicts = []
|
|
223
|
+
conflicts << 'with_max_timeout' if @max_timeout != 10
|
|
224
|
+
conflicts << 'with_proxy' if @proxy
|
|
225
|
+
conflicts << 'with_debug' if @debug
|
|
226
|
+
raise ArgumentError, "with_sender cannot be combined with: #{conflicts.join(', ')}. These options only apply to the built-in HTTP transport." unless conflicts.empty?
|
|
227
|
+
end
|
|
228
|
+
sender = @http_sender || NativeSender.new(@max_timeout, @proxy, @debug)
|
|
224
229
|
|
|
225
230
|
sender = StatusCodeSender.new(sender)
|
|
226
231
|
|
|
@@ -39,6 +39,8 @@ module SmartyStreets
|
|
|
39
39
|
add_parameter(request, 'search', lookup.search)
|
|
40
40
|
add_parameter(request, 'country', lookup.country)
|
|
41
41
|
add_parameter(request, 'max_results', lookup.max_results.to_s)
|
|
42
|
+
add_parameter(request, 'max_group_results', lookup.max_group_results.to_s)
|
|
43
|
+
add_parameter(request, 'geolocation', 'on') if lookup.geolocation
|
|
42
44
|
add_parameter(request, 'include_only_locality', lookup.locality)
|
|
43
45
|
add_parameter(request, 'include_only_postal_code', lookup.postal_code)
|
|
44
46
|
|
|
@@ -6,14 +6,16 @@ module SmartyStreets
|
|
|
6
6
|
# of the lookup after it comes back from the API.
|
|
7
7
|
class Lookup < JSONAble
|
|
8
8
|
|
|
9
|
-
attr_accessor :result, :search, :address_id, :country, :max_results, :locality, :postal_code, :custom_param_hash
|
|
9
|
+
attr_accessor :result, :search, :address_id, :country, :max_results, :max_group_results, :geolocation, :locality, :postal_code, :custom_param_hash
|
|
10
10
|
|
|
11
|
-
def initialize(search = nil, address_id = nil, country = nil, max_results = nil, locality = nil, postal_code = nil, custom_param_hash = nil)
|
|
11
|
+
def initialize(search = nil, address_id = nil, country = nil, max_results = nil, max_group_results = 100, geolocation = false, locality = nil, postal_code = nil, custom_param_hash = nil)
|
|
12
12
|
@result = []
|
|
13
13
|
@search = search
|
|
14
14
|
@address_id = address_id
|
|
15
15
|
@country = country
|
|
16
16
|
@max_results = max_results
|
|
17
|
+
@max_group_results = max_group_results
|
|
18
|
+
@geolocation = geolocation
|
|
17
19
|
@locality = locality
|
|
18
20
|
@postal_code = postal_code
|
|
19
21
|
@custom_param_hash = {}
|
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: 7.
|
|
4
|
+
version: 7.4.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: 2026-03-
|
|
11
|
+
date: 2026-03-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|