zipcode_locator 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f5b78f7c08e8e1715f181247b4b24728c5335978
4
+ data.tar.gz: 7f4503ecef0674087a4a6e5186eaba61e0354095
5
+ SHA512:
6
+ metadata.gz: 1661b93313b0c54893858787bf05ea5b38803bf0171181596ceca9951de8c3be271a7c6d7bfee0516012bf4151910c04e8e0850349e36a13400290800edcbc5c
7
+ data.tar.gz: fb6df51d021c55d8567299c42a9fa6aac8dd7f6ca04357caca5ba46b2df26ed36cb2e988d92b0ebfc21430bad0b4349a686335679e6b0019bf2e14f136a97818
data/.document ADDED
@@ -0,0 +1,5 @@
1
+ lib/**/*.rb
2
+ bin/*
3
+ -
4
+ features/**/*.feature
5
+ LICENSE.txt
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ source "http://rubygems.org"
2
+ # Add dependencies required to use your gem here.
3
+ # Example:
4
+ # gem "activesupport", ">= 2.3.5"
5
+
6
+ # Add dependencies to develop your gem here.
7
+ # Include everything needed to run rake, tests, features, etc.
8
+ group :development do
9
+ gem "shoulda", ">= 0"
10
+ gem "rdoc", "~> 3.12"
11
+ gem "bundler", "~> 1.0"
12
+ gem "jeweler", "~> 2.0.1"
13
+ gem "simplecov", ">= 0"
14
+ gem 'vcr'
15
+ gem 'webmock'
16
+ gem 'httparty'
17
+ end
data/Gemfile.lock ADDED
@@ -0,0 +1,94 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ activesupport (4.2.5.1)
5
+ i18n (~> 0.7)
6
+ json (~> 1.7, >= 1.7.7)
7
+ minitest (~> 5.1)
8
+ thread_safe (~> 0.3, >= 0.3.4)
9
+ tzinfo (~> 1.1)
10
+ addressable (2.4.0)
11
+ builder (3.2.2)
12
+ crack (0.4.3)
13
+ safe_yaml (~> 1.0.0)
14
+ descendants_tracker (0.0.4)
15
+ thread_safe (~> 0.3, >= 0.3.1)
16
+ docile (1.1.5)
17
+ faraday (0.9.2)
18
+ multipart-post (>= 1.2, < 3)
19
+ git (1.2.9.1)
20
+ github_api (0.13.1)
21
+ addressable (~> 2.4.0)
22
+ descendants_tracker (~> 0.0.4)
23
+ faraday (~> 0.8, < 0.10)
24
+ hashie (>= 3.4)
25
+ multi_json (>= 1.7.5, < 2.0)
26
+ oauth2
27
+ hashdiff (0.3.0)
28
+ hashie (3.4.3)
29
+ highline (1.7.8)
30
+ httparty (0.13.5)
31
+ json (~> 1.8)
32
+ multi_xml (>= 0.5.2)
33
+ i18n (0.7.0)
34
+ jeweler (2.0.1)
35
+ builder
36
+ bundler (>= 1.0)
37
+ git (>= 1.2.5)
38
+ github_api
39
+ highline (>= 1.6.15)
40
+ nokogiri (>= 1.5.10)
41
+ rake
42
+ rdoc
43
+ json (1.8.3)
44
+ jwt (1.5.1)
45
+ mini_portile2 (2.0.0)
46
+ minitest (5.8.4)
47
+ multi_json (1.11.2)
48
+ multi_xml (0.5.5)
49
+ multipart-post (2.0.0)
50
+ nokogiri (1.6.7.2)
51
+ mini_portile2 (~> 2.0.0.rc2)
52
+ oauth2 (1.1.0)
53
+ faraday (>= 0.8, < 0.10)
54
+ jwt (~> 1.0, < 1.5.2)
55
+ multi_json (~> 1.3)
56
+ multi_xml (~> 0.5)
57
+ rack (>= 1.2, < 3)
58
+ rack (1.6.4)
59
+ rake (10.5.0)
60
+ rdoc (3.12.2)
61
+ json (~> 1.4)
62
+ safe_yaml (1.0.4)
63
+ shoulda (3.5.0)
64
+ shoulda-context (~> 1.0, >= 1.0.1)
65
+ shoulda-matchers (>= 1.4.1, < 3.0)
66
+ shoulda-context (1.2.1)
67
+ shoulda-matchers (2.8.0)
68
+ activesupport (>= 3.0.0)
69
+ simplecov (0.11.2)
70
+ docile (~> 1.1.0)
71
+ json (~> 1.8)
72
+ simplecov-html (~> 0.10.0)
73
+ simplecov-html (0.10.0)
74
+ thread_safe (0.3.5)
75
+ tzinfo (1.2.2)
76
+ thread_safe (~> 0.1)
77
+ vcr (3.0.1)
78
+ webmock (1.24.2)
79
+ addressable (>= 2.3.6)
80
+ crack (>= 0.3.2)
81
+ hashdiff
82
+
83
+ PLATFORMS
84
+ ruby
85
+
86
+ DEPENDENCIES
87
+ bundler (~> 1.0)
88
+ httparty
89
+ jeweler (~> 2.0.1)
90
+ rdoc (~> 3.12)
91
+ shoulda
92
+ simplecov
93
+ vcr
94
+ webmock
data/LICENSE.txt ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2016 anildias
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,19 @@
1
+ = zipcode_locator
2
+
3
+ Description goes here.
4
+
5
+ == Contributing to zipcode_locator
6
+
7
+ * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
8
+ * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
9
+ * Fork the project.
10
+ * Start a feature/bugfix branch.
11
+ * Commit and push until you are happy with your contribution.
12
+ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
13
+ * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
14
+
15
+ == Copyright
16
+
17
+ Copyright (c) 2016 anildias. See LICENSE.txt for
18
+ further details.
19
+
data/Rakefile ADDED
@@ -0,0 +1,51 @@
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+ begin
6
+ Bundler.setup(:default, :development)
7
+ rescue Bundler::BundlerError => e
8
+ $stderr.puts e.message
9
+ $stderr.puts "Run `bundle install` to install missing gems"
10
+ exit e.status_code
11
+ end
12
+ require 'rake'
13
+
14
+ require 'jeweler'
15
+ Jeweler::Tasks.new do |gem|
16
+ # gem is a Gem::Specification... see http://guides.rubygems.org/specification-reference/ for more options
17
+ gem.name = "zipcode_locator"
18
+ gem.homepage = "http://github.com/anildias/zipcode_locator"
19
+ gem.license = "MIT"
20
+ gem.summary = %Q{Locate place with the help of Zip code API within a given distance by inputting zipcode}
21
+ gem.description = %Q{Locate place with the help of Zip code API within a given distance by inputting zipcode}
22
+ gem.email = "anildiasdavis@gmail.com"
23
+ gem.authors = ["anildias"]
24
+ # dependencies defined in Gemfile
25
+ end
26
+ Jeweler::RubygemsDotOrgTasks.new
27
+
28
+ require 'rake/testtask'
29
+ Rake::TestTask.new(:test) do |test|
30
+ test.libs << 'lib' << 'test'
31
+ test.pattern = 'test/**/test_*.rb'
32
+ test.verbose = true
33
+ end
34
+
35
+ desc "Code coverage detail"
36
+ task :simplecov do
37
+ ENV['COVERAGE'] = "true"
38
+ Rake::Task['test'].execute
39
+ end
40
+
41
+ task :default => :test
42
+
43
+ require 'rdoc/task'
44
+ Rake::RDocTask.new do |rdoc|
45
+ version = File.exist?('VERSION') ? File.read('VERSION') : ""
46
+
47
+ rdoc.rdoc_dir = 'rdoc'
48
+ rdoc.title = "locator #{version}"
49
+ rdoc.rdoc_files.include('README*')
50
+ rdoc.rdoc_files.include('lib/**/*.rb')
51
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.1
@@ -0,0 +1,14 @@
1
+
2
+ module Unit
3
+ DEFAULT_UNIT = "km"
4
+ AVAILABLE_UNITS = ["km", "mile", "radians", "degrees"]
5
+
6
+ def self.default_unit
7
+ DEFAULT_UNIT
8
+ end
9
+
10
+ def self.available_units
11
+ AVAILABLE_UNITS
12
+ end
13
+ end
14
+
@@ -0,0 +1,61 @@
1
+ require 'zipcode_locator/unit'
2
+
3
+ require 'httparty'
4
+
5
+ class ZipcodeLocator
6
+ DEFAULT_UNIT = "km"
7
+ DEFAULT_FORMAT = "json"
8
+ AVAILABLE_UNITS = ["km", "mile", "radians", "degrees"]
9
+ AVAILABLE_FORMATS = ["json", "xml", "csv"]
10
+
11
+ def initialize(api_key)
12
+ @api_key = api_key
13
+ end
14
+
15
+ def distance_between_zipcodes(zip_code1, zip_code2, unit = nil, format = nil)
16
+ format = AVAILABLE_FORMATS.include?(format) ? format : DEFAULT_FORMAT
17
+ unit = AVAILABLE_UNITS.include?(unit) ? unit : DEFAULT_UNIT
18
+ url = "http://www.zipcodeapi.com/rest/#{@api_key}/distance.#{format}/#{zip_code1}/#{zip_code2}/#{unit}"
19
+ JSON.parse(HTTParty.get(url).body)
20
+ end
21
+
22
+ def get_zipcodes_by_radius(zip_code, radius, unit = nil, format = nil)
23
+ format = AVAILABLE_FORMATS.include?(format) ? format : DEFAULT_FORMAT
24
+ unit = AVAILABLE_UNITS.include?(unit) ? unit : DEFAULT_UNIT
25
+ url = "http://www.zipcodeapi.com/rest/#{@api_key}/radius.#{format}/#{zip_code}/#{radius}/#{unit}"
26
+ JSON.parse(HTTParty.get(url).body)
27
+ end
28
+
29
+ # zip_codes = array of zipcodes
30
+ def find_close_zipcodes(zip_codes, distance, unit = nil, format = nil)
31
+ format = AVAILABLE_FORMATS.include?(format) ? format : DEFAULT_FORMAT
32
+ unit = AVAILABLE_UNITS.include?(unit) ? unit : DEFAULT_UNIT
33
+ zip_codes = zip_codes.join(',')
34
+ url = "http://www.zipcodeapi.com/rest/#{@api_key}/match-close.#{format}/#{zip_codes}/#{distance}/#{unit}"
35
+ JSON.parse(HTTParty.get(url).body)
36
+ end
37
+
38
+ def zipcode_location_info(zip_code, unit = nil, format = nil)
39
+ format = AVAILABLE_FORMATS.include?(format) ? format : DEFAULT_FORMAT
40
+ unit = AVAILABLE_UNITS.include?(unit) ? unit : DEFAULT_UNIT
41
+ url = "http://www.zipcodeapi.com/rest/#{@api_key}/info.#{format}/#{zip_code}/#{unit}"
42
+ JSON.parse(HTTParty.get(url).body)
43
+ end
44
+
45
+ # zip_codes = array of zipcodes
46
+ def multi_zipcodes_location_info(zip_codes, unit = nil, format = nil)
47
+ format = AVAILABLE_FORMATS.include?(format) ? format : DEFAULT_FORMAT
48
+ unit = AVAILABLE_UNITS.include?(unit) ? unit : DEFAULT_UNIT
49
+ zip_codes = zip_codes.join(',')
50
+ url = "http://www.zipcodeapi.com/rest/#{@api_key}/multi-info.#{format}/#{zip_codes}/#{unit}"
51
+ JSON.parse(HTTParty.get(url).body)
52
+ end
53
+
54
+ def get_zipcodes_by_locations(city, state)
55
+ city = city.delete(' ')
56
+ state = state.delete(' ')
57
+ url = "http://www.zipcodeapi.com/rest/#{@api_key}/city-zips.#{DEFAULT_FORMAT}/#{city}/#{state}"
58
+ JSON.parse(HTTParty.get(url).body)
59
+ end
60
+
61
+ end
data/test/helper.rb ADDED
@@ -0,0 +1,40 @@
1
+ require 'simplecov'
2
+ require 'vcr'
3
+
4
+ VCR.configure do |config|
5
+ config.cassette_library_dir = "test/vcr_cassettes"
6
+ config.hook_into :webmock # or :fakeweb
7
+ end
8
+
9
+ module SimpleCov::Configuration
10
+ def clean_filters
11
+ @filters = []
12
+ end
13
+ end
14
+
15
+ SimpleCov.configure do
16
+ clean_filters
17
+ load_adapter 'test_frameworks'
18
+ end
19
+
20
+ ENV["COVERAGE"] && SimpleCov.start do
21
+ add_filter "/.rvm/"
22
+ end
23
+ require 'rubygems'
24
+ require 'bundler'
25
+ begin
26
+ Bundler.setup(:default, :development)
27
+ rescue Bundler::BundlerError => e
28
+ $stderr.puts e.message
29
+ $stderr.puts "Run `bundle install` to install missing gems"
30
+ exit e.status_code
31
+ end
32
+ require 'minitest/autorun'
33
+ require 'shoulda'
34
+
35
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
36
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
37
+ require 'locator'
38
+
39
+ class Minitest::Test
40
+ end
@@ -0,0 +1,65 @@
1
+ require 'helper'
2
+
3
+ class TestZipcodeLocator < Minitest::Test
4
+
5
+ @@loc = ZipcodeLocator.new('3YJBA4WF9vpMJWjnh0otcznhkPzlsuRwtB74F4KOz9Bj6VGnV4Q8EepY3Zkwtc2X')
6
+
7
+ def test_distance_between_zipcodes()
8
+ test_zipcode1 = 10001
9
+ test_zipcode2 = 10005
10
+ VCR.use_cassette("distance_between_zipcodes", :record => :new_episodes) do
11
+ res = @@loc.distance_between_zipcodes(10001, 10005)
12
+ response = Net::HTTP.get_response(URI("http://www.zipcodeapi.com/rest/3YJBA4WF9vpMJWjnh0otcznhkPzlsuRwtB74F4KOz9Bj6VGnV4Q8EepY3Zkwtc2X/distance.json/#{test_zipcode1}/#{test_zipcode2}/km"))
13
+ assert_equal res, JSON.parse(response.body)
14
+ end
15
+ end
16
+
17
+ def test_get_zipcodes_by_radius()
18
+ test_zipcode = 10001
19
+ test_radius = 5
20
+ VCR.use_cassette("get_zipcodes_by_radius", :record => :new_episodes) do
21
+ res = @@loc.get_zipcodes_by_radius(10001, 5)
22
+ response = Net::HTTP.get_response(URI("http://www.zipcodeapi.com/rest/3YJBA4WF9vpMJWjnh0otcznhkPzlsuRwtB74F4KOz9Bj6VGnV4Q8EepY3Zkwtc2X/radius.json/#{test_zipcode}/#{test_radius}/km"))
23
+ assert_equal res, JSON.parse(response.body)
24
+ end
25
+ end
26
+
27
+ def test_find_close_zipcodes()
28
+ test_zipcodes = "10001,10005"
29
+ test_distance = 5
30
+ VCR.use_cassette("close_zipcodes", :record => :new_episodes) do
31
+ res = @@loc.find_close_zipcodes([10001, 10005], 5)
32
+ response = Net::HTTP.get_response(URI("http://www.zipcodeapi.com/rest/3YJBA4WF9vpMJWjnh0otcznhkPzlsuRwtB74F4KOz9Bj6VGnV4Q8EepY3Zkwtc2X/match-close.json/#{test_zipcodes}/#{test_distance}/km"))
33
+ assert_equal res, JSON.parse(response.body)
34
+ end
35
+ end
36
+
37
+ def test_zipcode_location_info()
38
+ test_zipcode = 10001
39
+ VCR.use_cassette("zipcode_location_info", :record => :new_episodes) do
40
+ res = @@loc.zipcode_location_info(10001)
41
+ response = Net::HTTP.get_response(URI("http://www.zipcodeapi.com/rest/3YJBA4WF9vpMJWjnh0otcznhkPzlsuRwtB74F4KOz9Bj6VGnV4Q8EepY3Zkwtc2X/info.json/#{test_zipcode}/km"))
42
+ assert_equal res, JSON.parse(response.body)
43
+ end
44
+ end
45
+
46
+ def test_multi_zipcodes_location_info()
47
+ test_zipcodes = "10001,10005"
48
+ VCR.use_cassette("multi_zipcodes_location_info", :record => :new_episodes) do
49
+ res = @@loc.multi_zipcodes_location_info([10001, 10005], 5)
50
+ response = Net::HTTP.get_response(URI("http://www.zipcodeapi.com/rest/3YJBA4WF9vpMJWjnh0otcznhkPzlsuRwtB74F4KOz9Bj6VGnV4Q8EepY3Zkwtc2X/multi-info.json/#{test_zipcodes}/km"))
51
+ assert_equal res, JSON.parse(response.body)
52
+ end
53
+ end
54
+
55
+ def test_get_zipcodes_by_locations()
56
+ test_city = "NewYork"
57
+ test_state = "NY"
58
+ VCR.use_cassette("zipcode_by_location", :record => :new_episodes) do
59
+ res = @@loc.get_zipcodes_by_locations("NewYork", "NY")
60
+ response = Net::HTTP.get_response(URI("http://www.zipcodeapi.com/rest/3YJBA4WF9vpMJWjnh0otcznhkPzlsuRwtB74F4KOz9Bj6VGnV4Q8EepY3Zkwtc2X/city-zips.json/#{test_city}/#{test_state}/km"))
61
+ assert_equal res, JSON.parse(response.body)
62
+ end
63
+ end
64
+
65
+ end
@@ -0,0 +1,155 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: http://www.zipcodeapi.com/rest/3YJBA4WF9vpMJWjnh0otcznhkPzlsuRwtB74F4KOz9Bj6VGnV4Q8EepY3Zkwtc2X/match-close.json/10001,10005/5/km
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept-Encoding:
11
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
12
+ Accept:
13
+ - "*/*"
14
+ User-Agent:
15
+ - Ruby
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Date:
22
+ - Tue, 08 Mar 2016 11:34:06 GMT
23
+ Server:
24
+ - Apache/2.4.16 (Amazon) OpenSSL/1.0.1k-fips PHP/5.5.29
25
+ X-Powered-By:
26
+ - PHP/5.5.29
27
+ Content-Length:
28
+ - '2'
29
+ Content-Type:
30
+ - application/json
31
+ body:
32
+ encoding: UTF-8
33
+ string: "[]"
34
+ http_version:
35
+ recorded_at: Tue, 08 Mar 2016 11:34:06 GMT
36
+ - request:
37
+ method: get
38
+ uri: http://www.zipcodeapi.com/rest/3YJBA4WF9vpMJWjnh0otcznhkPzlsuRwtB74F4KOz9Bj6VGnV4Q8EepY3Zkwtc2X/match-close.json/10001,10005/5/km
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ Accept-Encoding:
44
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
45
+ Accept:
46
+ - "*/*"
47
+ User-Agent:
48
+ - Ruby
49
+ Host:
50
+ - www.zipcodeapi.com
51
+ response:
52
+ status:
53
+ code: 200
54
+ message: OK
55
+ headers:
56
+ Date:
57
+ - Tue, 08 Mar 2016 11:35:38 GMT
58
+ Server:
59
+ - Apache/2.4.16 (Amazon) OpenSSL/1.0.1k-fips PHP/5.5.29
60
+ X-Powered-By:
61
+ - PHP/5.5.29
62
+ Content-Length:
63
+ - '2'
64
+ Content-Type:
65
+ - application/json
66
+ body:
67
+ encoding: UTF-8
68
+ string: "[]"
69
+ http_version:
70
+ recorded_at: Tue, 08 Mar 2016 11:35:39 GMT
71
+ - request:
72
+ method: get
73
+ uri: http://www.zipcodeapi.com/rest/3YJBA4WF9vpMJWjnh0otcznhkPzlsuRwtB74F4KOz9Bj6VGnV4Q8EepY3Zkwtc2X/multi-info.json/10001,10005/km
74
+ body:
75
+ encoding: US-ASCII
76
+ string: ''
77
+ headers:
78
+ Accept-Encoding:
79
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
80
+ Accept:
81
+ - "*/*"
82
+ User-Agent:
83
+ - Ruby
84
+ Host:
85
+ - www.zipcodeapi.com
86
+ response:
87
+ status:
88
+ code: 200
89
+ message: OK
90
+ headers:
91
+ Date:
92
+ - Tue, 08 Mar 2016 11:39:13 GMT
93
+ Server:
94
+ - Apache/2.4.16 (Amazon) OpenSSL/1.0.1k-fips PHP/5.5.29
95
+ X-Powered-By:
96
+ - PHP/5.5.29
97
+ Vary:
98
+ - Accept-Encoding
99
+ Content-Length:
100
+ - '300'
101
+ Content-Type:
102
+ - application/json
103
+ body:
104
+ encoding: UTF-8
105
+ string: '{"10001":{"zip_code":"10001","lat":40.75065,"lng":-73.996924,"city":"New
106
+ York","state":"NY","timezone":{"timezone_identifier":"America\/New_York","timezone_abbr":"EST","utc_offset_sec":-18000,"is_dst":"F"},"acceptable_city_names":[{"city":"Empire
107
+ State","state":"NY"},{"city":"G P O","state":"NY"},{"city":"Greeley Square","state":"NY"},{"city":"Macys
108
+ Finance","state":"NY"},{"city":"Manhattan","state":"NY"}]},"10005":{"zip_code":"10005","lat":40.706015,"lng":-74.008959,"city":"New
109
+ York","state":"NY","timezone":{"timezone_identifier":"America\/New_York","timezone_abbr":"EST","utc_offset_sec":-18000,"is_dst":"F"},"acceptable_city_names":[{"city":"Manhattan","state":"NY"},{"city":"Nyc","state":"NY"},{"city":"Wall
110
+ Street","state":"NY"}]}}'
111
+ http_version:
112
+ recorded_at: Tue, 08 Mar 2016 11:39:14 GMT
113
+ - request:
114
+ method: get
115
+ uri: http://www.zipcodeapi.com/rest/3YJBA4WF9vpMJWjnh0otcznhkPzlsuRwtB74F4KOz9Bj6VGnV4Q8EepY3Zkwtc2X/multi-info.json/10001,10005/km
116
+ body:
117
+ encoding: US-ASCII
118
+ string: ''
119
+ headers:
120
+ Accept-Encoding:
121
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
122
+ Accept:
123
+ - "*/*"
124
+ User-Agent:
125
+ - Ruby
126
+ Host:
127
+ - www.zipcodeapi.com
128
+ response:
129
+ status:
130
+ code: 200
131
+ message: OK
132
+ headers:
133
+ Date:
134
+ - Tue, 08 Mar 2016 11:48:12 GMT
135
+ Server:
136
+ - Apache/2.4.16 (Amazon) OpenSSL/1.0.1k-fips PHP/5.5.29
137
+ X-Powered-By:
138
+ - PHP/5.5.29
139
+ Vary:
140
+ - Accept-Encoding
141
+ Content-Length:
142
+ - '300'
143
+ Content-Type:
144
+ - application/json
145
+ body:
146
+ encoding: UTF-8
147
+ string: '{"10001":{"zip_code":"10001","lat":40.75065,"lng":-73.996924,"city":"New
148
+ York","state":"NY","timezone":{"timezone_identifier":"America\/New_York","timezone_abbr":"EST","utc_offset_sec":-18000,"is_dst":"F"},"acceptable_city_names":[{"city":"Empire
149
+ State","state":"NY"},{"city":"G P O","state":"NY"},{"city":"Greeley Square","state":"NY"},{"city":"Macys
150
+ Finance","state":"NY"},{"city":"Manhattan","state":"NY"}]},"10005":{"zip_code":"10005","lat":40.706015,"lng":-74.008959,"city":"New
151
+ York","state":"NY","timezone":{"timezone_identifier":"America\/New_York","timezone_abbr":"EST","utc_offset_sec":-18000,"is_dst":"F"},"acceptable_city_names":[{"city":"Manhattan","state":"NY"},{"city":"Nyc","state":"NY"},{"city":"Wall
152
+ Street","state":"NY"}]}}'
153
+ http_version:
154
+ recorded_at: Tue, 08 Mar 2016 11:48:12 GMT
155
+ recorded_with: VCR 3.0.1