apiverve_zipcodes 1.2.4 → 1.2.5
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/README.md +15 -4
- data/lib/apiverve_zipcodes/client.rb +2 -2
- data/lib/apiverve_zipcodes.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5904114612604d0c253b69322fd04c5373dd4738940f4841cc2e8de37d58b72f
|
|
4
|
+
data.tar.gz: 5a00c26ac19306457d0cf5e40ee09c729304091de0e36d486a81bc6d4bef18a3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 192414fa992ee78d9a39407c170710db4f465b09a48556672065b0da0f0dd068615a3bae58eb939e7a6f6736c40f4893edd1b1104891c8ade92e49a2434d352f
|
|
7
|
+
data.tar.gz: '09688b5050f88664f48d4885ea7cbb92d0cfb3550433d0f3360cf164e312583327f20d63b1108c70ed7d88cc3f4e80f3859c7a6f46b80abe33075709d4797972'
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Zip Codes Lookup API - Ruby Gem
|
|
2
2
|
|
|
3
|
-
Zip Codes Lookup finds all postal codes within a US city or resolves a five-digit ZIP code to its city and state. Paid plans add geographic coordinates.
|
|
3
|
+
Zip Codes Lookup finds all postal codes within a US city or resolves a five-digit ZIP code to its city and state. Paid plans add the IANA time zone, geographic coordinates and the distance from the ZIP to a second ZIP.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -35,7 +35,10 @@ require 'apiverve_zipcodes'
|
|
|
35
35
|
client = APIVerve::Zipcodes::Client.new(api_key: "YOUR_API_KEY")
|
|
36
36
|
|
|
37
37
|
# Make a request
|
|
38
|
-
response = client.execute({
|
|
38
|
+
response = client.execute({
|
|
39
|
+
zip: "64082",
|
|
40
|
+
distanceTo: "64106"
|
|
41
|
+
})
|
|
39
42
|
|
|
40
43
|
# Print the response
|
|
41
44
|
puts response
|
|
@@ -46,7 +49,7 @@ puts response
|
|
|
46
49
|
|
|
47
50
|
```ruby
|
|
48
51
|
begin
|
|
49
|
-
response = client.execute({ zip: "64082" })
|
|
52
|
+
response = client.execute({ zip: "64082", distanceTo: "64106" })
|
|
50
53
|
puts response["data"]
|
|
51
54
|
rescue APIVerve::Zipcodes::ValidationError => e
|
|
52
55
|
puts "Validation error: #{e.errors.join(', ')}"
|
|
@@ -78,7 +81,15 @@ client = APIVerve::Zipcodes::Client.new(
|
|
|
78
81
|
"latitude": "38.850243",
|
|
79
82
|
"longitude": "-94.39570",
|
|
80
83
|
"city": "Lees Summit",
|
|
81
|
-
"state": "Missouri"
|
|
84
|
+
"state": "Missouri",
|
|
85
|
+
"timezone": "America/Chicago",
|
|
86
|
+
"distance": {
|
|
87
|
+
"zipcode": "64106",
|
|
88
|
+
"city": "Kansas City",
|
|
89
|
+
"state_abbr": "MO",
|
|
90
|
+
"miles": 19.94,
|
|
91
|
+
"kilometers": 32.09
|
|
92
|
+
}
|
|
82
93
|
}
|
|
83
94
|
}
|
|
84
95
|
```
|
|
@@ -10,7 +10,7 @@ module APIVerve
|
|
|
10
10
|
#
|
|
11
11
|
# @example Basic usage
|
|
12
12
|
# client = APIVerve::Zipcodes::Client.new(api_key: "your_api_key")
|
|
13
|
-
# response = client.execute({ zip: "64082" })
|
|
13
|
+
# response = client.execute({ zip: "64082", distanceTo: "64106" })
|
|
14
14
|
# puts response
|
|
15
15
|
#
|
|
16
16
|
# @see https://apiverve.com/marketplace/zipcodes?utm_source=ruby&utm_medium=referral&utm_content=readme
|
|
@@ -19,7 +19,7 @@ module APIVerve
|
|
|
19
19
|
DEFAULT_TIMEOUT = 30
|
|
20
20
|
|
|
21
21
|
# Validation rules for parameters
|
|
22
|
-
VALIDATION_RULES = { 'zip' => { type: 'string', required: true, min_length: 5, max_length: 5 } }
|
|
22
|
+
VALIDATION_RULES = { 'zip' => { type: 'string', required: true, min_length: 5, max_length: 5 }, 'distanceTo' => { type: 'string', required: false, min_length: 5, max_length: 5 } }
|
|
23
23
|
|
|
24
24
|
# Format validation patterns
|
|
25
25
|
FORMAT_PATTERNS = {
|
data/lib/apiverve_zipcodes.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: apiverve_zipcodes
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- APIVerve
|
|
@@ -58,7 +58,8 @@ dependencies:
|
|
|
58
58
|
- !ruby/object:Gem::Version
|
|
59
59
|
version: '2.0'
|
|
60
60
|
description: Zip Codes Lookup finds all postal codes within a US city or resolves
|
|
61
|
-
a five-digit ZIP code to its city and state. Paid plans add
|
|
61
|
+
a five-digit ZIP code to its city and state. Paid plans add the IANA time zone,
|
|
62
|
+
geographic coordinates and the distance from the ZIP to a second ZIP.
|
|
62
63
|
email:
|
|
63
64
|
- hello@apiverve.com
|
|
64
65
|
executables: []
|