smartystreets_ruby_sdk 5.14.17 → 5.14.19
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 +0 -1
- data/README.md +1 -1
- data/examples/international_autocomplete_example.rb +10 -5
- data/examples/international_example.rb +12 -9
- data/examples/us_autocomplete_pro_example.rb +8 -6
- data/examples/us_extract_example.rb +19 -11
- data/examples/us_reverse_geo_example.rb +10 -7
- data/examples/us_street_multiple_address_example.rb +15 -11
- data/examples/us_street_single_address_example.rb +13 -10
- data/examples/us_zipcode_multiple_lookup_example.rb +13 -10
- data/examples/us_zipcode_single_lookup_example.rb +12 -9
- data/lib/smartystreets_ruby_sdk/international_autocomplete/client.rb +7 -0
- data/lib/smartystreets_ruby_sdk/international_autocomplete/international_geolocation_type.rb +11 -0
- data/lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb +7 -2
- data/lib/smartystreets_ruby_sdk/international_autocomplete/suggestion.rb +3 -1
- data/lib/smartystreets_ruby_sdk/us_extract/client.rb +5 -0
- data/lib/smartystreets_ruby_sdk/us_extract/lookup.rb +3 -2
- data/lib/smartystreets_ruby_sdk/version.rb +1 -1
- data/smartystreets_ruby_sdk.gemspec +2 -2
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e609ade5576ee698d017763741d4925df7114893fd10bdafe7c75c9fd696a26f
|
4
|
+
data.tar.gz: 30cd9475ae7c7beb5237631b5d38ee80194802915f9575a96b27e8ba401fbe3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ad81fe8396c827d8e22f46a6df017ed948afee0fea897b4f27733dafe2ffefeefab87e7638ac861e309f93da33717d766e440c458fe83ec5f4cea580752dd9e
|
7
|
+
data.tar.gz: 69202d3af2e77f9089c65c235e89215dd9f373e435ce6c99f4fece459e9a373b3f2dbb528b171a79bf7d3006ecac73e0444b1329f171198df97e31cba3fd4576
|
data/Makefile
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
#### SMARTY DISCLAIMER: Subject to the terms of the associated license agreement, this software is freely available for your use. This software is FREE, AS IN PUPPIES, and is a gift. Enjoy your new responsibility. This means that while we may consider enhancement requests, we may or may not choose to entertain requests at our sole and absolute discretion.
|
2
2
|
|
3
3
|
# SmartyStreets Ruby SDK
|
4
4
|
|
@@ -1,21 +1,25 @@
|
|
1
|
-
require 'smartystreets_ruby_sdk/shared_credentials'
|
1
|
+
require '../lib/smartystreets_ruby_sdk/shared_credentials'
|
2
|
+
require '../lib/smartystreets_ruby_sdk/static_credentials'
|
2
3
|
require '../lib/smartystreets_ruby_sdk/client_builder'
|
3
4
|
require '../lib/smartystreets_ruby_sdk/international_autocomplete/lookup'
|
4
5
|
require '../lib/smartystreets_ruby_sdk/international_autocomplete/client'
|
6
|
+
require '../lib/smartystreets_ruby_sdk/international_autocomplete/international_geolocation_type'
|
5
7
|
|
6
8
|
class InternationalAutocompleteExample
|
7
9
|
Lookup = SmartyStreets::InternationalAutocomplete::Lookup
|
8
10
|
|
9
11
|
def run
|
10
|
-
# key = 'Your SmartyStreets Auth
|
11
|
-
#
|
12
|
-
|
12
|
+
# key = 'Your SmartyStreets Auth Key here'
|
13
|
+
# referer = 'Your host name here'
|
13
14
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
14
15
|
key = ENV['SMARTY_AUTH_WEB']
|
15
16
|
referer = ENV['SMARTY_AUTH_REFERER']
|
16
|
-
|
17
17
|
credentials = SmartyStreets::SharedCredentials.new(key, referer)
|
18
18
|
|
19
|
+
# id = ENV['SMARTY_AUTH_ID']
|
20
|
+
# token = ENV['SMARTY_AUTH_TOKEN']
|
21
|
+
# credentials = SmartyStreets::StaticCredentials.new(id, token)
|
22
|
+
|
19
23
|
# The appropriate license values to be used for your subscriptions
|
20
24
|
# can be found on the Subscriptions page of the account dashboard.
|
21
25
|
# https://www.smartystreets.com/docs/cloud/licensing
|
@@ -28,6 +32,7 @@ class InternationalAutocompleteExample
|
|
28
32
|
lookup = Lookup.new('Louis')
|
29
33
|
lookup.country = "FRA"
|
30
34
|
lookup.locality = "Paris"
|
35
|
+
lookup.geolocation = SmartyStreets::InternationalAutocomplete::InternationalGeolocationType::NONE
|
31
36
|
|
32
37
|
suggestions = client.send(lookup) # The client will also return the suggestions directly
|
33
38
|
|
@@ -1,19 +1,22 @@
|
|
1
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
2
|
-
require 'smartystreets_ruby_sdk/
|
3
|
-
require 'smartystreets_ruby_sdk/
|
1
|
+
require '../lib/smartystreets_ruby_sdk/static_credentials'
|
2
|
+
require '../lib/smartystreets_ruby_sdk/shared_credentials'
|
3
|
+
require '../lib/smartystreets_ruby_sdk/client_builder'
|
4
|
+
require '../lib/smartystreets_ruby_sdk/international_street/lookup'
|
4
5
|
|
5
6
|
class InternationalExample
|
6
7
|
Lookup = SmartyStreets::InternationalStreet::Lookup
|
7
8
|
|
8
9
|
def run
|
9
|
-
#
|
10
|
-
#
|
11
|
-
|
10
|
+
# key = 'Your SmartyStreets Auth Key here'
|
11
|
+
# referer = 'Your host name here'
|
12
12
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
13
|
-
|
14
|
-
|
13
|
+
key = ENV['SMARTY_AUTH_WEB']
|
14
|
+
referer = ENV['SMARTY_AUTH_REFERER']
|
15
|
+
credentials = SmartyStreets::SharedCredentials.new(key, referer)
|
15
16
|
|
16
|
-
|
17
|
+
# id = ENV['SMARTY_AUTH_ID']
|
18
|
+
# token = ENV['SMARTY_AUTH_TOKEN']
|
19
|
+
# credentials = SmartyStreets::StaticCredentials.new(id, token)
|
17
20
|
|
18
21
|
# The appropriate license values to be used for your subscriptions
|
19
22
|
# can be found on the Subscriptions page of the account dashboard.
|
@@ -1,5 +1,5 @@
|
|
1
|
-
require 'smartystreets_ruby_sdk/shared_credentials'
|
2
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
1
|
+
require '../lib/smartystreets_ruby_sdk/shared_credentials'
|
2
|
+
require '../lib/smartystreets_ruby_sdk/static_credentials'
|
3
3
|
require '../lib/smartystreets_ruby_sdk/client_builder'
|
4
4
|
require '../lib/smartystreets_ruby_sdk/us_autocomplete_pro/lookup'
|
5
5
|
|
@@ -7,15 +7,17 @@ class USAutocompleteProExample
|
|
7
7
|
Lookup = SmartyStreets::USAutocompletePro::Lookup
|
8
8
|
|
9
9
|
def run
|
10
|
-
# key = 'Your SmartyStreets Auth
|
11
|
-
#
|
12
|
-
|
10
|
+
# key = 'Your SmartyStreets Auth Key here'
|
11
|
+
# referer = 'Your host name here'
|
13
12
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
14
13
|
key = ENV['SMARTY_AUTH_WEB']
|
15
14
|
referer = ENV['SMARTY_AUTH_REFERER']
|
16
|
-
|
17
15
|
credentials = SmartyStreets::SharedCredentials.new(key, referer)
|
18
16
|
|
17
|
+
# id = ENV['SMARTY_AUTH_ID']
|
18
|
+
# token = ENV['SMARTY_AUTH_TOKEN']
|
19
|
+
# credentials = SmartyStreets::StaticCredentials.new(id, token)
|
20
|
+
|
19
21
|
# auth_id = ENV['SMARTY_AUTH_ID']
|
20
22
|
# auth_token = ENV['SMARTY_AUTH_TOKEN']
|
21
23
|
#
|
@@ -1,25 +1,32 @@
|
|
1
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
2
|
-
require 'smartystreets_ruby_sdk/
|
3
|
-
require 'smartystreets_ruby_sdk/
|
1
|
+
require '../lib/smartystreets_ruby_sdk/static_credentials'
|
2
|
+
require '../lib/smartystreets_ruby_sdk/shared_credentials'
|
3
|
+
require '../lib/smartystreets_ruby_sdk/client_builder'
|
4
|
+
require '../lib/smartystreets_ruby_sdk/us_extract/lookup'
|
5
|
+
require '../lib/smartystreets_ruby_sdk/us_street/match_type'
|
6
|
+
|
4
7
|
|
5
8
|
class USExtractExample
|
6
9
|
Lookup = SmartyStreets::USExtract::Lookup
|
7
10
|
|
8
11
|
def run
|
9
|
-
#
|
10
|
-
#
|
11
|
-
|
12
|
+
# key = 'Your SmartyStreets Auth Key here'
|
13
|
+
# referer = 'Your host name here'
|
12
14
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
13
|
-
|
14
|
-
|
15
|
+
key = ENV['SMARTY_AUTH_WEB']
|
16
|
+
referer = ENV['SMARTY_AUTH_REFERER']
|
17
|
+
credentials = SmartyStreets::SharedCredentials.new(key, referer)
|
15
18
|
|
16
|
-
|
19
|
+
# id = ENV['SMARTY_AUTH_ID']
|
20
|
+
# token = ENV['SMARTY_AUTH_TOKEN']
|
21
|
+
# credentials = SmartyStreets::StaticCredentials.new(id, token)
|
17
22
|
|
18
23
|
client = SmartyStreets::ClientBuilder.new(credentials).build_us_extract_api_client
|
19
24
|
|
20
|
-
text = "Here is some text.\r\nMy address is 3785 Las
|
25
|
+
text = "Here is some text.\r\nMy address is 3785 Las Vegas Av." \
|
21
26
|
"\r\nLos Vegas, Nevada." \
|
22
|
-
"\r\nMeet me at 1 Rosedale Baltimore Maryland, not at 123 Phony Street, Boise Idaho."
|
27
|
+
"\r\nMeet me at 1 Rosedale Baltimore Maryland, not at 123 Phony Street, Boise Idaho." \
|
28
|
+
"\r\nAlso, here's a non-postal that will show up with enhanced match! 808 County Road 408 Brady, Tx. " \
|
29
|
+
"is a beautiful place!"
|
23
30
|
|
24
31
|
# Documentation for input fields can be found at:
|
25
32
|
# https://smartystreets.com/docs/cloud/us-extract-api
|
@@ -28,6 +35,7 @@ class USExtractExample
|
|
28
35
|
lookup.aggressive = true
|
29
36
|
lookup.addresses_have_line_breaks = false
|
30
37
|
lookup.addresses_per_line = 2
|
38
|
+
lookup.match = SmartyStreets::USStreet::MatchType::ENHANCED
|
31
39
|
|
32
40
|
result = client.send(lookup)
|
33
41
|
|
@@ -1,4 +1,5 @@
|
|
1
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
1
|
+
require '../lib/smartystreets_ruby_sdk/static_credentials'
|
2
|
+
require '../lib/smartystreets_ruby_sdk/shared_credentials'
|
2
3
|
require '../lib/smartystreets_ruby_sdk/client_builder'
|
3
4
|
require '../lib/smartystreets_ruby_sdk/us_reverse_geo/lookup'
|
4
5
|
|
@@ -6,14 +7,16 @@ class USReverseGeoExample
|
|
6
7
|
Lookup = SmartyStreets::USReverseGeo::Lookup
|
7
8
|
|
8
9
|
def run
|
9
|
-
#
|
10
|
-
#
|
11
|
-
|
10
|
+
# key = 'Your SmartyStreets Auth Key here'
|
11
|
+
# referer = 'Your host name here'
|
12
12
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
13
|
-
|
14
|
-
|
13
|
+
key = ENV['SMARTY_AUTH_WEB']
|
14
|
+
referer = ENV['SMARTY_AUTH_REFERER']
|
15
|
+
credentials = SmartyStreets::SharedCredentials.new(key, referer)
|
15
16
|
|
16
|
-
|
17
|
+
# id = ENV['SMARTY_AUTH_ID']
|
18
|
+
# token = ENV['SMARTY_AUTH_TOKEN']
|
19
|
+
# credentials = SmartyStreets::StaticCredentials.new(id, token)
|
17
20
|
|
18
21
|
# The appropriate license values to be used for your subscriptions
|
19
22
|
# can be found on the Subscriptions page of the account dashboard.
|
@@ -1,20 +1,24 @@
|
|
1
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
2
|
-
require 'smartystreets_ruby_sdk/
|
3
|
-
require 'smartystreets_ruby_sdk/
|
4
|
-
require 'smartystreets_ruby_sdk/
|
1
|
+
require '../lib/smartystreets_ruby_sdk/static_credentials'
|
2
|
+
require '../lib/smartystreets_ruby_sdk/shared_credentials'
|
3
|
+
require '../lib/smartystreets_ruby_sdk/client_builder'
|
4
|
+
require '../lib/smartystreets_ruby_sdk/batch'
|
5
|
+
require '../lib/smartystreets_ruby_sdk/us_street/lookup'
|
6
|
+
require '../lib/smartystreets_ruby_sdk/us_street/match_type'
|
5
7
|
|
6
8
|
class USStreetMultipleAddressExample
|
7
9
|
Lookup = SmartyStreets::USStreet::Lookup
|
8
10
|
|
9
11
|
def run
|
10
|
-
#
|
11
|
-
#
|
12
|
-
|
12
|
+
# key = 'Your SmartyStreets Auth Key here'
|
13
|
+
# referer = 'Your host name here'
|
13
14
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
14
|
-
|
15
|
-
|
15
|
+
key = ENV['SMARTY_AUTH_WEB']
|
16
|
+
referer = ENV['SMARTY_AUTH_REFERER']
|
17
|
+
credentials = SmartyStreets::SharedCredentials.new(key, referer)
|
16
18
|
|
17
|
-
|
19
|
+
# id = ENV['SMARTY_AUTH_ID']
|
20
|
+
# token = ENV['SMARTY_AUTH_TOKEN']
|
21
|
+
# credentials = SmartyStreets::StaticCredentials.new(id, token)
|
18
22
|
|
19
23
|
# The appropriate license values to be used for your subscriptions
|
20
24
|
# can be found on the Subscriptions page of the account dashboard.
|
@@ -36,7 +40,7 @@ class USStreetMultipleAddressExample
|
|
36
40
|
batch[0].lastline = 'Mountain view, California'
|
37
41
|
batch[0].zipcode = '21229'
|
38
42
|
batch[0].candidates = 3
|
39
|
-
batch[0].match =
|
43
|
+
batch[0].match = SmartyStreets::USStreet::MatchType::INVALID # "invalid" is the most permissive match,
|
40
44
|
# this will always return at least one result even if the address is invalid.
|
41
45
|
# Refer to the documentation for additional Match Strategy options.
|
42
46
|
|
@@ -1,18 +1,21 @@
|
|
1
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
2
|
-
require 'smartystreets_ruby_sdk/
|
3
|
-
require 'smartystreets_ruby_sdk/
|
4
|
-
require 'smartystreets_ruby_sdk/us_street/
|
1
|
+
require '../lib/smartystreets_ruby_sdk/static_credentials'
|
2
|
+
require '../lib/smartystreets_ruby_sdk/shared_credentials'
|
3
|
+
require '../lib/smartystreets_ruby_sdk/client_builder'
|
4
|
+
require '../lib/smartystreets_ruby_sdk/us_street/lookup'
|
5
|
+
require '../lib/smartystreets_ruby_sdk/us_street/match_type'
|
5
6
|
|
6
7
|
class USStreetSingleAddressExample
|
7
8
|
def run
|
8
|
-
#
|
9
|
-
#
|
10
|
-
|
9
|
+
# key = 'Your SmartyStreets Auth Key here'
|
10
|
+
# referer = 'Your host name here'
|
11
11
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
12
|
-
|
13
|
-
|
12
|
+
key = ENV['SMARTY_AUTH_WEB']
|
13
|
+
referer = ENV['SMARTY_AUTH_REFERER']
|
14
|
+
credentials = SmartyStreets::SharedCredentials.new(key, referer)
|
14
15
|
|
15
|
-
|
16
|
+
# id = ENV['SMARTY_AUTH_ID']
|
17
|
+
# token = ENV['SMARTY_AUTH_TOKEN']
|
18
|
+
# credentials = SmartyStreets::StaticCredentials.new(id, token)
|
16
19
|
|
17
20
|
# The appropriate license values to be used for your subscriptions
|
18
21
|
# can be found on the Subscriptions page of the account dashboard.
|
@@ -1,20 +1,23 @@
|
|
1
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
2
|
-
require 'smartystreets_ruby_sdk/
|
3
|
-
require 'smartystreets_ruby_sdk/
|
4
|
-
require 'smartystreets_ruby_sdk/
|
1
|
+
require '../lib/smartystreets_ruby_sdk/static_credentials'
|
2
|
+
require '../lib/smartystreets_ruby_sdk/shared_credentials'
|
3
|
+
require '../lib/smartystreets_ruby_sdk/client_builder'
|
4
|
+
require '../lib/smartystreets_ruby_sdk/batch'
|
5
|
+
require '../lib/smartystreets_ruby_sdk/us_zipcode/lookup'
|
5
6
|
|
6
7
|
class USZipcodeMultipleLookupExample
|
7
8
|
Lookup = SmartyStreets::USZipcode::Lookup
|
8
9
|
|
9
10
|
def run
|
10
|
-
#
|
11
|
-
#
|
12
|
-
|
11
|
+
# key = 'Your SmartyStreets Auth Key here'
|
12
|
+
# referer = 'Your host name here'
|
13
13
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
14
|
-
|
15
|
-
|
14
|
+
key = ENV['SMARTY_AUTH_WEB']
|
15
|
+
referer = ENV['SMARTY_AUTH_REFERER']
|
16
|
+
credentials = SmartyStreets::SharedCredentials.new(key, referer)
|
16
17
|
|
17
|
-
|
18
|
+
# id = ENV['SMARTY_AUTH_ID']
|
19
|
+
# token = ENV['SMARTY_AUTH_TOKEN']
|
20
|
+
# credentials = SmartyStreets::StaticCredentials.new(id, token)
|
18
21
|
|
19
22
|
client = SmartyStreets::ClientBuilder.new(credentials).build_us_zipcode_api_client
|
20
23
|
batch = SmartyStreets::Batch.new
|
@@ -1,17 +1,20 @@
|
|
1
|
-
require 'smartystreets_ruby_sdk/static_credentials'
|
2
|
-
require 'smartystreets_ruby_sdk/
|
3
|
-
require 'smartystreets_ruby_sdk/
|
1
|
+
require '../lib/smartystreets_ruby_sdk/static_credentials'
|
2
|
+
require '../lib/smartystreets_ruby_sdk/shared_credentials'
|
3
|
+
require '../lib/smartystreets_ruby_sdk/client_builder'
|
4
|
+
require '../lib/smartystreets_ruby_sdk/us_zipcode/lookup'
|
4
5
|
|
5
6
|
class UsZipcodeSingleLookupExample
|
6
7
|
def run
|
7
|
-
#
|
8
|
-
#
|
9
|
-
|
8
|
+
# key = 'Your SmartyStreets Auth Key here'
|
9
|
+
# referer = 'Your host name here'
|
10
10
|
# We recommend storing your secret keys in environment variables instead---it's safer!
|
11
|
-
|
12
|
-
|
11
|
+
key = ENV['SMARTY_AUTH_WEB']
|
12
|
+
referer = ENV['SMARTY_AUTH_REFERER']
|
13
|
+
credentials = SmartyStreets::SharedCredentials.new(key, referer)
|
13
14
|
|
14
|
-
|
15
|
+
# id = ENV['SMARTY_AUTH_ID']
|
16
|
+
# token = ENV['SMARTY_AUTH_TOKEN']
|
17
|
+
# credentials = SmartyStreets::StaticCredentials.new(id, token)
|
15
18
|
|
16
19
|
client = SmartyStreets::ClientBuilder.new(credentials).build_us_zipcode_api_client
|
17
20
|
|
@@ -34,9 +34,16 @@ module SmartyStreets
|
|
34
34
|
|
35
35
|
add_parameter(request, 'search', lookup.search)
|
36
36
|
add_parameter(request, 'country', lookup.country)
|
37
|
+
add_parameter(request, 'max_results', lookup.max_results.to_s)
|
38
|
+
add_parameter(request, 'distance', lookup.distance.to_s)
|
39
|
+
if lookup.geolocation != InternationalGeolocationType::NONE && lookup.geolocation != nil
|
40
|
+
add_parameter(request, 'geolocation', lookup.geolocation)
|
41
|
+
end
|
37
42
|
add_parameter(request, 'include_only_administrative_area', lookup.administrative_area)
|
38
43
|
add_parameter(request, 'include_only_locality', lookup.locality)
|
39
44
|
add_parameter(request, 'include_only_postal_code', lookup.postal_code)
|
45
|
+
add_parameter(request, 'latitude', lookup.latitude.to_s)
|
46
|
+
add_parameter(request, 'longitude', lookup.longitude.to_s)
|
40
47
|
|
41
48
|
request
|
42
49
|
end
|
@@ -6,15 +6,20 @@ 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, :country, :administrative_area, :locality, :postal_code
|
9
|
+
attr_accessor :result, :search, :country, :max_results, :distance, :geolocation, :administrative_area, :locality, :postal_code, :latitude, :longitude
|
10
10
|
|
11
|
-
def initialize(search=nil, country=nil, administrative_area=nil, locality=nil, postal_code=nil)
|
11
|
+
def initialize(search = nil, country = nil, max_results = nil, distance = nil, geolocation = nil, administrative_area = nil, locality = nil, postal_code = nil, latitude = nil, longitude = nil)
|
12
12
|
@result = []
|
13
13
|
@search = search
|
14
14
|
@country = country
|
15
|
+
@max_results = max_results
|
16
|
+
@distance = distance
|
17
|
+
@geolocation = geolocation
|
15
18
|
@administrative_area = administrative_area
|
16
19
|
@locality = locality
|
17
20
|
@postal_code = postal_code
|
21
|
+
@latitude = latitude
|
22
|
+
@longitude = longitude
|
18
23
|
end
|
19
24
|
end
|
20
25
|
end
|
@@ -2,12 +2,14 @@ module SmartyStreets
|
|
2
2
|
module InternationalAutocomplete
|
3
3
|
class Suggestion
|
4
4
|
|
5
|
-
attr_reader :street, :locality, :administrative_area, :postal_code, :country_iso3
|
5
|
+
attr_reader :street, :locality, :administrative_area, :super_administrative_area, :sub_administrative_area, :postal_code, :country_iso3
|
6
6
|
|
7
7
|
def initialize(obj)
|
8
8
|
@street = obj.fetch('street', nil)
|
9
9
|
@locality = obj.fetch('locality', nil)
|
10
10
|
@administrative_area = obj.fetch('administrative_area', nil)
|
11
|
+
@super_administrative_area = obj.fetch('super_administrative_area', nil)
|
12
|
+
@sub_administrative_area = obj.fetch('sub_administrative_area', nil)
|
11
13
|
@postal_code = obj.fetch('postal_code', nil)
|
12
14
|
@country_iso3 = obj.fetch('country_iso3', nil)
|
13
15
|
end
|
@@ -1,6 +1,8 @@
|
|
1
1
|
require_relative '../request'
|
2
2
|
require_relative '../exceptions'
|
3
3
|
require_relative 'result'
|
4
|
+
require_relative '../us_street/match_type'
|
5
|
+
|
4
6
|
|
5
7
|
module SmartyStreets
|
6
8
|
module USExtract
|
@@ -35,6 +37,9 @@ module SmartyStreets
|
|
35
37
|
add_parameter(request, 'aggressive', lookup.aggressive.to_s)
|
36
38
|
add_parameter(request, 'addr_line_breaks', lookup.addresses_have_line_breaks.to_s)
|
37
39
|
add_parameter(request, 'addr_per_line', lookup.addresses_per_line.to_s)
|
40
|
+
if lookup.match != SmartyStreets::USStreet::MatchType::STRICT && lookup.match != nil
|
41
|
+
add_parameter(request, 'match', lookup.match)
|
42
|
+
end
|
38
43
|
|
39
44
|
request
|
40
45
|
end
|
@@ -7,14 +7,15 @@ 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
|
10
|
+
attr_accessor :text, :result, :aggressive, :addresses_per_line, :html, :addresses_have_line_breaks, :match
|
11
11
|
|
12
|
-
def initialize(text=nil, html=nil, aggressive=nil, addresses_have_line_breaks=nil, addresses_per_line=nil)
|
12
|
+
def initialize(text=nil, html=nil, aggressive=nil, addresses_have_line_breaks=nil, addresses_per_line=nil, match=nil)
|
13
13
|
@text = text
|
14
14
|
@html = html
|
15
15
|
@aggressive = aggressive
|
16
16
|
@addresses_have_line_breaks = addresses_have_line_breaks
|
17
17
|
@addresses_per_line = addresses_per_line
|
18
|
+
@match = match
|
18
19
|
@result = nil
|
19
20
|
end
|
20
21
|
end
|
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
|
22
|
-
spec.add_development_dependency 'bundler', '~> 2.
|
23
|
-
spec.add_development_dependency 'rake', '~>
|
22
|
+
spec.add_development_dependency 'bundler', '~> 2.4.6'
|
23
|
+
spec.add_development_dependency 'rake', '~> 13.0.6'
|
24
24
|
spec.add_development_dependency 'minitest', '~> 5.8', '>= 5.8.3'
|
25
25
|
spec.add_development_dependency 'simplecov', '~> 0.12.0'
|
26
26
|
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.14.
|
4
|
+
version: 5.14.19
|
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:
|
11
|
+
date: 2023-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.4.6
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: 2.4.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 13.0.6
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 13.0.6
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: minitest
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -107,6 +107,7 @@ files:
|
|
107
107
|
- lib/smartystreets_ruby_sdk/errors.rb
|
108
108
|
- lib/smartystreets_ruby_sdk/exceptions.rb
|
109
109
|
- lib/smartystreets_ruby_sdk/international_autocomplete/client.rb
|
110
|
+
- lib/smartystreets_ruby_sdk/international_autocomplete/international_geolocation_type.rb
|
110
111
|
- lib/smartystreets_ruby_sdk/international_autocomplete/lookup.rb
|
111
112
|
- lib/smartystreets_ruby_sdk/international_autocomplete/suggestion.rb
|
112
113
|
- lib/smartystreets_ruby_sdk/international_street.rb
|