smartystreets_ruby_sdk 5.20.4 → 5.20.6
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 +2 -0
- data/examples/international_example.rb +2 -0
- data/examples/us_autocomplete_pro_example.rb +2 -0
- data/examples/us_enrichment_example.rb +3 -1
- data/examples/us_extract_example.rb +2 -0
- data/examples/us_reverse_geo_example.rb +2 -0
- data/examples/us_street_multiple_address_example.rb +2 -0
- data/examples/us_street_single_address_example.rb +3 -0
- data/examples/us_zipcode_multiple_lookup_example.rb +2 -0
- data/examples/us_zipcode_single_lookup_example.rb +2 -0
- data/lib/smartystreets_ruby_sdk/international_autocomplete/client.rb +4 -0
- data/lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb +7 -2
- data/lib/smartystreets_ruby_sdk/international_street/client.rb +4 -0
- data/lib/smartystreets_ruby_sdk/international_street/lookup.rb +6 -1
- data/lib/smartystreets_ruby_sdk/us_autocomplete_pro/client.rb +4 -0
- data/lib/smartystreets_ruby_sdk/us_autocomplete_pro/lookup.rb +7 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/client.rb +3 -0
- data/lib/smartystreets_ruby_sdk/us_enrichment/geo_reference/lookup.rb +7 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/lookup.rb +7 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/property/financial/lookup.rb +7 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/property/principal/lookup.rb +7 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/count/lookup.rb +7 -2
- data/lib/smartystreets_ruby_sdk/us_enrichment/secondary/lookup.rb +7 -2
- data/lib/smartystreets_ruby_sdk/us_extract/client.rb +4 -0
- data/lib/smartystreets_ruby_sdk/us_extract/lookup.rb +7 -2
- data/lib/smartystreets_ruby_sdk/us_reverse_geo/client.rb +4 -0
- data/lib/smartystreets_ruby_sdk/us_reverse_geo/lookup.rb +7 -2
- data/lib/smartystreets_ruby_sdk/us_street/client.rb +6 -0
- data/lib/smartystreets_ruby_sdk/us_street/lookup.rb +9 -2
- data/lib/smartystreets_ruby_sdk/us_street/match_type.rb +5 -0
- data/lib/smartystreets_ruby_sdk/us_zipcode/client.rb +4 -0
- data/lib/smartystreets_ruby_sdk/us_zipcode/lookup.rb +7 -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: fb1b572ed0d7aba94f6e82270f168dac48b8f2814f9a91802a319f582ad4d7d6
|
4
|
+
data.tar.gz: 270bfca4f6bba08d859695b76f19ce6e0b0247d2a4fb23cfdb545f0e5189638f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1bfd01e7f995219aac05c965e00e76db458f7dae632820284aa6e921676f1562d6e7ca30fa2a055561df2d64d4214946527f3cc1cb7dabf06d4298bd831af46
|
7
|
+
data.tar.gz: 3e62baa76c824148527367128b27ab849f022f89572213fa5b8e99f38b1548baca72726b3f91eca9ad084e929843356c9462cc1ff4ac12d5a7cbb9c12ccf058d
|
@@ -38,6 +38,8 @@ class InternationalExample
|
|
38
38
|
lookup.country = 'Brazil'
|
39
39
|
lookup.postal_code = '02516-050'
|
40
40
|
|
41
|
+
# lookup.add_custom_parameter('parameter', 'value')
|
42
|
+
|
41
43
|
candidates = client.send_lookup(lookup) # The candidates are also stored in the lookup's 'result' field.
|
42
44
|
|
43
45
|
first_candidate = candidates[0]
|
@@ -33,7 +33,9 @@ class USEnrichmentAddressExample
|
|
33
33
|
lookup.city = "Somerville"
|
34
34
|
lookup.state = "NJ"
|
35
35
|
lookup.zipcode = "08876"
|
36
|
-
#lookup.etag = "AUBAGDQDAIGQYCYC"
|
36
|
+
# lookup.etag = "AUBAGDQDAIGQYCYC"
|
37
|
+
|
38
|
+
# lookup.add_custom_parameter('parameter', 'value')
|
37
39
|
|
38
40
|
# Or, create a freeform lookup to search using a single line address
|
39
41
|
freeform_lookup = SmartyStreets::USEnrichment::Lookup.new
|
@@ -44,6 +44,8 @@ class USStreetMultipleAddressExample
|
|
44
44
|
# this will always return at least one result even if the address is invalid.
|
45
45
|
# Refer to the documentation for additional Match Strategy options.
|
46
46
|
|
47
|
+
# batch[0].add_custom_parameter('parameter', 'value')
|
48
|
+
|
47
49
|
batch.add(Lookup.new('1 Rosedale, Baltimore, Maryland')) # Freeform addresses work too.
|
48
50
|
batch[1].candidates = 10 # Allows up to ten possible matches to be returned (default is 1).
|
49
51
|
|
@@ -40,11 +40,14 @@ class USStreetSingleAddressExample
|
|
40
40
|
lookup.state = 'CA'
|
41
41
|
lookup.zipcode = '21229'
|
42
42
|
lookup.candidates = 3
|
43
|
+
lookup.county_source = SmartyStreets::USStreet::CountySource::GEOGRAPHIC
|
43
44
|
lookup.match = SmartyStreets::USStreet::MatchType::INVALID
|
44
45
|
# "invalid" is the most permissive match,
|
45
46
|
# this will always return at least one result even if the address is invalid.
|
46
47
|
# Refer to the documentation for additional Match Strategy options.
|
47
48
|
|
49
|
+
# lookup.add_custom_parameter('parameter', 'value')
|
50
|
+
|
48
51
|
begin
|
49
52
|
client.send_lookup(lookup)
|
50
53
|
rescue SmartyStreets::SmartyError => err
|
@@ -29,6 +29,8 @@ class USZipcodeMultipleLookupExample
|
|
29
29
|
batch[0].input_id = '01189998819991197253' # Optional ID from your system
|
30
30
|
batch[0].zipcode = '12345' # A Lookup may have a ZIP Code, city and state, or city, state, and ZIP Code
|
31
31
|
|
32
|
+
# batch[0].add_custom_parameter('parameter', 'value')
|
33
|
+
|
32
34
|
batch.add(Lookup.new)
|
33
35
|
batch[1].city = 'Phoenix'
|
34
36
|
batch[1].state = 'Arizona'
|
@@ -42,6 +42,10 @@ module SmartyStreets
|
|
42
42
|
add_parameter(request, 'include_only_locality', lookup.locality)
|
43
43
|
add_parameter(request, 'include_only_postal_code', lookup.postal_code)
|
44
44
|
|
45
|
+
for key in lookup.custom_param_hash.keys do
|
46
|
+
add_parameter(request, key, lookup.custom_param_hash[key])
|
47
|
+
end
|
48
|
+
|
45
49
|
request
|
46
50
|
end
|
47
51
|
|
@@ -6,9 +6,9 @@ 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
|
9
|
+
attr_accessor :result, :search, :address_id, :country, :max_results, :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)
|
11
|
+
def initialize(search = nil, address_id = nil, country = nil, max_results = nil, locality = nil, postal_code = nil, custom_param_hash = nil)
|
12
12
|
@result = []
|
13
13
|
@search = search
|
14
14
|
@address_id = address_id
|
@@ -16,6 +16,11 @@ module SmartyStreets
|
|
16
16
|
@max_results = max_results
|
17
17
|
@locality = locality
|
18
18
|
@postal_code = postal_code
|
19
|
+
@custom_param_hash = {}
|
20
|
+
end
|
21
|
+
|
22
|
+
def add_custom_parameter(parameter, value)
|
23
|
+
@custom_param_hash[parameter] = value
|
19
24
|
end
|
20
25
|
end
|
21
26
|
end
|
@@ -54,6 +54,10 @@ module SmartyStreets
|
|
54
54
|
add_parameter(request, 'administrative_area', lookup.administrative_area)
|
55
55
|
add_parameter(request, 'postal_code', lookup.postal_code)
|
56
56
|
|
57
|
+
for key in lookup.custom_param_hash.keys do
|
58
|
+
add_parameter(request, key, lookup.custom_param_hash[key])
|
59
|
+
end
|
60
|
+
|
57
61
|
request
|
58
62
|
end
|
59
63
|
|
@@ -15,7 +15,7 @@ module SmartyStreets
|
|
15
15
|
class Lookup
|
16
16
|
|
17
17
|
attr_accessor :input_id, :freeform, :locality, :postal_code, :address3, :address2, :inputId, :address1,
|
18
|
-
:geocode, :administrative_area, :country, :organization, :language, :address4, :result
|
18
|
+
:geocode, :administrative_area, :country, :organization, :language, :address4, :result, :custom_param_hash
|
19
19
|
|
20
20
|
def initialize(freeform=nil, country=nil)
|
21
21
|
@result = []
|
@@ -33,6 +33,11 @@ module SmartyStreets
|
|
33
33
|
@locality = nil
|
34
34
|
@administrative_area = nil
|
35
35
|
@postal_code = nil
|
36
|
+
@custom_param_hash = {}
|
37
|
+
end
|
38
|
+
|
39
|
+
def add_custom_parameter(parameter, value)
|
40
|
+
@custom_param_hash[parameter] = value
|
36
41
|
end
|
37
42
|
|
38
43
|
def missing_country
|
@@ -10,11 +10,11 @@ module SmartyStreets
|
|
10
10
|
|
11
11
|
attr_accessor :result, :search, :max_results, :city_filter, :state_filter, :zip_filter,
|
12
12
|
:exclude_states, :prefer_cities, :prefer_states, :prefer_zip_codes, :prefer_ratio,
|
13
|
-
:prefer_geolocation, :selected, :source
|
13
|
+
:prefer_geolocation, :selected, :source, :custom_param_hash
|
14
14
|
|
15
15
|
def initialize(search=nil, max_results=nil, city_filter=nil, state_filter=nil, zip_filter=nil,
|
16
16
|
exclude_states=nil, prefer_cities=nil, prefer_states=nil, prefer_zips=nil, prefer_ratio=nil,
|
17
|
-
prefer_geolocation=nil, selected=nil, source=nil)
|
17
|
+
prefer_geolocation=nil, selected=nil, source=nil, custom_param_hash=nil)
|
18
18
|
@result = []
|
19
19
|
@search = search
|
20
20
|
@max_results = max_results
|
@@ -29,6 +29,11 @@ module SmartyStreets
|
|
29
29
|
@prefer_geolocation = prefer_geolocation
|
30
30
|
@selected = selected
|
31
31
|
@source = source
|
32
|
+
@custom_param_hash = {}
|
33
|
+
end
|
34
|
+
|
35
|
+
def add_custom_parameter(parameter, value)
|
36
|
+
@custom_param_hash[parameter] = value
|
32
37
|
end
|
33
38
|
|
34
39
|
def add_city_filter(city)
|
@@ -105,6 +105,9 @@ module SmartyStreets
|
|
105
105
|
smarty_request.url_components = '/' + lookup.smarty_key + '/' + lookup.data_set + '/' + lookup.data_sub_set
|
106
106
|
end
|
107
107
|
end
|
108
|
+
for key in lookup.custom_param_hash.keys do
|
109
|
+
add_parameter(smarty_request, key, lookup.custom_param_hash[key])
|
110
|
+
end
|
108
111
|
|
109
112
|
|
110
113
|
response = @sender.send(smarty_request)
|
@@ -2,13 +2,18 @@ module SmartyStreets
|
|
2
2
|
module USEnrichment
|
3
3
|
module GeoReference
|
4
4
|
class Lookup
|
5
|
-
attr_reader :smarty_key, :data_set, :data_sub_set, :etag
|
5
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :etag, :custom_param_hash
|
6
6
|
|
7
|
-
def initialize(smarty_key, etag=nil)
|
7
|
+
def initialize(smarty_key, etag=nil, custom_param_hash=nil)
|
8
8
|
@smarty_key = smarty_key
|
9
9
|
@data_set = 'geo-reference'
|
10
10
|
@data_sub_set = nil
|
11
11
|
@etag = etag
|
12
|
+
@custom_param_hash = {}
|
13
|
+
end
|
14
|
+
|
15
|
+
def add_custom_parameter(parameter, value)
|
16
|
+
@custom_param_hash[parameter] = value
|
12
17
|
end
|
13
18
|
end
|
14
19
|
end
|
@@ -2,9 +2,9 @@ require_relative '../json_able'
|
|
2
2
|
module SmartyStreets
|
3
3
|
module USEnrichment
|
4
4
|
class Lookup < JSONAble
|
5
|
-
attr_accessor :smarty_key, :data_set, :data_sub_set, :freeform, :street, :city, :state, :zipcode, :etag
|
5
|
+
attr_accessor :smarty_key, :data_set, :data_sub_set, :freeform, :street, :city, :state, :zipcode, :etag, :custom_param_hash
|
6
6
|
|
7
|
-
def initialize(smarty_key=nil, data_set=nil, data_sub_set=nil, freeform=nil, street=nil, city=nil, state=nil, zipcode=nil, etag=nil)
|
7
|
+
def initialize(smarty_key=nil, data_set=nil, data_sub_set=nil, freeform=nil, street=nil, city=nil, state=nil, zipcode=nil, etag=nil, custom_param_hash=nil)
|
8
8
|
@smarty_key = smarty_key
|
9
9
|
@data_set = data_set
|
10
10
|
@data_sub_set = data_sub_set
|
@@ -14,6 +14,11 @@ module SmartyStreets
|
|
14
14
|
@state = state
|
15
15
|
@zipcode = zipcode
|
16
16
|
@etag = etag
|
17
|
+
@custom_param_hash = {}
|
18
|
+
end
|
19
|
+
|
20
|
+
def add_custom_parameter(parameter, value)
|
21
|
+
@custom_param_hash[parameter] = value
|
17
22
|
end
|
18
23
|
end
|
19
24
|
end
|
@@ -3,13 +3,18 @@ module SmartyStreets
|
|
3
3
|
module Property
|
4
4
|
module Financial
|
5
5
|
class Lookup
|
6
|
-
attr_reader :smarty_key, :data_set, :data_sub_set, :etag
|
6
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :etag, :custom_param_hash
|
7
7
|
|
8
|
-
def initialize(smarty_key, etag=nil)
|
8
|
+
def initialize(smarty_key, etag=nil, custom_param_hash=nil)
|
9
9
|
@smarty_key = smarty_key
|
10
10
|
@data_set = "property"
|
11
11
|
@data_sub_set = "financial"
|
12
12
|
@etag = etag
|
13
|
+
@custom_param_hash = {}
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_custom_parameter(parameter, value)
|
17
|
+
@custom_param_hash[parameter] = value
|
13
18
|
end
|
14
19
|
end
|
15
20
|
end
|
@@ -3,13 +3,18 @@ module SmartyStreets
|
|
3
3
|
module Property
|
4
4
|
module Principal
|
5
5
|
class Lookup
|
6
|
-
attr_reader :smarty_key, :data_set, :data_sub_set, :etag
|
6
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :etag, :custom_param_hash
|
7
7
|
|
8
|
-
def initialize(smarty_key, etag=nil)
|
8
|
+
def initialize(smarty_key, etag=nil, custom_param_hash=nil)
|
9
9
|
@smarty_key = smarty_key
|
10
10
|
@data_set = "property"
|
11
11
|
@data_sub_set = "principal"
|
12
12
|
@etag = etag
|
13
|
+
@custom_param_hash = {}
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_custom_parameter(parameter, value)
|
17
|
+
@custom_param_hash[parameter] = value
|
13
18
|
end
|
14
19
|
end
|
15
20
|
end
|
@@ -3,13 +3,18 @@ module SmartyStreets
|
|
3
3
|
module Secondary
|
4
4
|
module Count
|
5
5
|
class Lookup
|
6
|
-
attr_reader :smarty_key, :data_set, :data_sub_set, :etag
|
6
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :etag, :custom_param_hash
|
7
7
|
|
8
|
-
def initialize(smarty_key, etag=nil)
|
8
|
+
def initialize(smarty_key, etag=nil, custom_param_hash=nil)
|
9
9
|
@smarty_key = smarty_key
|
10
10
|
@data_set = "secondary"
|
11
11
|
@data_sub_set = "count"
|
12
12
|
@etag = etag
|
13
|
+
@custom_param_hash = {}
|
14
|
+
end
|
15
|
+
|
16
|
+
def add_custom_parameter(parameter, value)
|
17
|
+
@custom_param_hash[parameter] = value
|
13
18
|
end
|
14
19
|
end
|
15
20
|
end
|
@@ -2,13 +2,18 @@ module SmartyStreets
|
|
2
2
|
module USEnrichment
|
3
3
|
module Secondary
|
4
4
|
class Lookup
|
5
|
-
attr_reader :smarty_key, :data_set, :data_sub_set, :etag
|
5
|
+
attr_reader :smarty_key, :data_set, :data_sub_set, :etag, :custom_param_hash
|
6
6
|
|
7
|
-
def initialize(smarty_key, etag=nil)
|
7
|
+
def initialize(smarty_key, etag=nil, custom_param_hash=nil)
|
8
8
|
@smarty_key = smarty_key
|
9
9
|
@data_set = "secondary"
|
10
10
|
@data_sub_set = nil
|
11
11
|
@etag = etag
|
12
|
+
@custom_param_hash = {}
|
13
|
+
end
|
14
|
+
|
15
|
+
def add_custom_parameter(parameter, value)
|
16
|
+
@custom_param_hash[parameter] = value
|
12
17
|
end
|
13
18
|
end
|
14
19
|
end
|
@@ -7,9 +7,9 @@ module SmartyStreets
|
|
7
7
|
#
|
8
8
|
# See "https://smartystreets.com/docs/cloud/us-extract-api#http-request-input-fields"
|
9
9
|
class Lookup < JSONAble
|
10
|
-
attr_accessor :text, :result, :aggressive, :addresses_per_line, :html, :addresses_have_line_breaks, :match
|
10
|
+
attr_accessor :text, :result, :aggressive, :addresses_per_line, :html, :addresses_have_line_breaks, :match, :custom_param_hash
|
11
11
|
|
12
|
-
def initialize(text=nil, html=nil, aggressive=nil, addresses_have_line_breaks=nil, addresses_per_line=nil, match=nil)
|
12
|
+
def initialize(text=nil, html=nil, aggressive=nil, addresses_have_line_breaks=nil, addresses_per_line=nil, match=nil, custom_param_hash=nil)
|
13
13
|
@text = text
|
14
14
|
@html = html
|
15
15
|
@aggressive = aggressive
|
@@ -17,6 +17,11 @@ module SmartyStreets
|
|
17
17
|
@addresses_per_line = addresses_per_line
|
18
18
|
@match = match
|
19
19
|
@result = nil
|
20
|
+
@custom_param_hash = {}
|
21
|
+
end
|
22
|
+
|
23
|
+
def add_custom_parameter(parameter, value)
|
24
|
+
@custom_param_hash[parameter] = value
|
20
25
|
end
|
21
26
|
end
|
22
27
|
end
|
@@ -28,6 +28,10 @@ module SmartyStreets
|
|
28
28
|
add_parameter(request, 'longitude', lookup.longitude)
|
29
29
|
add_parameter(request, 'source', lookup.source)
|
30
30
|
|
31
|
+
for key in lookup.custom_param_hash.keys do
|
32
|
+
add_parameter(request, key, lookup.custom_param_hash[key])
|
33
|
+
end
|
34
|
+
|
31
35
|
request
|
32
36
|
end
|
33
37
|
|
@@ -10,12 +10,17 @@ module SmartyStreets
|
|
10
10
|
|
11
11
|
class Lookup
|
12
12
|
|
13
|
-
attr_accessor :latitude, :longitude, :source, :response
|
13
|
+
attr_accessor :latitude, :longitude, :source, :response, :custom_param_hash
|
14
14
|
|
15
|
-
def initialize(latitude, longitude, source)
|
15
|
+
def initialize(latitude, longitude, source=nil, custom_param_hash=nil)
|
16
16
|
@latitude = sprintf('%.8f', latitude)
|
17
17
|
@longitude = sprintf('%.8f', longitude)
|
18
18
|
@source = source
|
19
|
+
@custom_param_hash = {}
|
20
|
+
end
|
21
|
+
|
22
|
+
def add_custom_parameter(parameter, value)
|
23
|
+
@custom_param_hash[parameter] = value
|
19
24
|
end
|
20
25
|
end
|
21
26
|
end
|
@@ -62,6 +62,12 @@ module SmartyStreets
|
|
62
62
|
converted_lookup['match'] = lookup.match
|
63
63
|
converted_lookup['candidates'] = lookup.candidates
|
64
64
|
converted_lookup['format'] = lookup.format
|
65
|
+
converted_lookup['county_source'] = lookup.county_source
|
66
|
+
|
67
|
+
for key in lookup.custom_param_hash.keys do
|
68
|
+
converted_lookup[key] = lookup.custom_param_hash[key]
|
69
|
+
end
|
70
|
+
|
65
71
|
converted_obj.push(converted_lookup)
|
66
72
|
end
|
67
73
|
converted_obj
|
@@ -9,10 +9,10 @@ module SmartyStreets
|
|
9
9
|
# @match:: Must be set to 'strict', 'enhanced', or 'invalid'. Constants for these are in match_type.rb
|
10
10
|
class Lookup < JSONAble
|
11
11
|
attr_accessor :input_id, :street, :street2, :secondary, :city, :state, :zipcode, :lastline, :addressee, :urbanization,
|
12
|
-
:match, :candidates, :format, :result
|
12
|
+
:match, :candidates, :format, :county_source, :custom_param_hash, :result
|
13
13
|
|
14
14
|
def initialize(street=nil, street2=nil, secondary=nil, city=nil, state=nil, zipcode=nil, lastline=nil,
|
15
|
-
addressee=nil, urbanization=nil, match=nil, candidates=0, input_id=nil, format=nil)
|
15
|
+
addressee=nil, urbanization=nil, match=nil, candidates=0, input_id=nil, county_source=nil, format=nil)
|
16
16
|
@input_id = input_id
|
17
17
|
@street = street
|
18
18
|
@street2 = street2
|
@@ -26,8 +26,15 @@ module SmartyStreets
|
|
26
26
|
@match = match
|
27
27
|
@candidates = candidates
|
28
28
|
@format = format
|
29
|
+
@county_source = county_source
|
30
|
+
@custom_param_hash = {}
|
29
31
|
@result = []
|
30
32
|
end
|
33
|
+
|
34
|
+
def add_custom_parameter(parameter, value)
|
35
|
+
@custom_param_hash[parameter] = value
|
36
|
+
end
|
37
|
+
|
31
38
|
end
|
32
39
|
end
|
33
40
|
end
|
@@ -58,6 +58,10 @@ module SmartyStreets
|
|
58
58
|
add_field(converted_lookup, 'state', lookup.state)
|
59
59
|
add_field(converted_lookup, 'zipcode', lookup.zipcode)
|
60
60
|
|
61
|
+
for key in lookup.custom_param_hash.keys do
|
62
|
+
add_field(converted_lookup, key, lookup.custom_param_hash[key])
|
63
|
+
end
|
64
|
+
|
61
65
|
converted_obj.push(converted_lookup)
|
62
66
|
end
|
63
67
|
|
@@ -7,14 +7,19 @@ module SmartyStreets
|
|
7
7
|
#
|
8
8
|
# See "https://smartystreets.com/docs/cloud/us-zipcode-api#http-request-input-fields"
|
9
9
|
class Lookup < JSONAble
|
10
|
-
attr_accessor :result, :state, :zipcode, :input_id, :city
|
10
|
+
attr_accessor :result, :state, :zipcode, :input_id, :city, :custom_param_hash
|
11
11
|
|
12
|
-
def initialize(city=nil, state=nil, zipcode=nil, input_id=nil)
|
12
|
+
def initialize(city=nil, state=nil, zipcode=nil, input_id=nil, custom_param_hash=nil)
|
13
13
|
@result = nil
|
14
14
|
@input_id = input_id
|
15
15
|
@city = city
|
16
16
|
@state = state
|
17
17
|
@zipcode = zipcode
|
18
|
+
@custom_param_hash = {}
|
19
|
+
end
|
20
|
+
|
21
|
+
def add_custom_parameter(parameter, value)
|
22
|
+
@custom_param_hash[parameter] = value
|
18
23
|
end
|
19
24
|
end
|
20
25
|
end
|
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: 5.20.
|
4
|
+
version: 5.20.6
|
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: 2024-11-
|
11
|
+
date: 2024-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|