melissa_data 0.2.12 → 0.2.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/lib/melissa_data/version.rb +1 -1
- data/lib/melissa_data/web_smart/client.rb +18 -10
- data/melissa_data.gemspec +1 -0
- metadata +6 -5
- data/.ruby_version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9396713cb4f41daf6d74fd6ad64bbb080156eb20
|
4
|
+
data.tar.gz: a38a780b35cf7badece913b9ccce0ab72dda97f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84c3a718b4bad198c785667ccc9e09891e8f0c5646513b3b247f20bf7fd9b1e65b4685bf736a7c8e772ef4931091987674c5db45b49410afe67c04ebc699c08e
|
7
|
+
data.tar.gz: b0b50944871289d9e146fda85fd8026386f862f4128554be6c7e24ced3e4d75f44bf669aa09dee6335446c60439ae715e5d50e4e5eadccffc3894fb34c67a687
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
melissa_data
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.3.3
|
data/lib/melissa_data/version.rb
CHANGED
@@ -9,15 +9,23 @@ module MelissaData
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def property_by_apn(fips:, apn:)
|
12
|
-
|
13
|
-
|
14
|
-
res
|
12
|
+
@response = process(@client.property_by_apn(fips: fips, apn: apn), 'property')
|
13
|
+
resolve_response
|
15
14
|
end
|
16
15
|
|
17
16
|
def property_by_address_key(address_key:)
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
@response = process(@client.property_by_address_key(address_key: address_key), 'property')
|
18
|
+
resolve_response
|
19
|
+
end
|
20
|
+
|
21
|
+
def success?
|
22
|
+
!@response.key?(:errors)
|
23
|
+
end
|
24
|
+
|
25
|
+
def resolve_response
|
26
|
+
return @response unless success?
|
27
|
+
add_coordinates(@response) unless MelissaData::GeoLookup::Geocoder.coordinates? @response
|
28
|
+
@response
|
21
29
|
end
|
22
30
|
|
23
31
|
def address(address:, city:, state:, zip:, country: "USA")
|
@@ -30,10 +38,10 @@ module MelissaData
|
|
30
38
|
end
|
31
39
|
|
32
40
|
def add_coordinates(response)
|
33
|
-
addr = response
|
34
|
-
city = response
|
35
|
-
state = response
|
36
|
-
zip = response
|
41
|
+
addr = response.dig(:property_address, :address)
|
42
|
+
city = response.dig(:property_address, :city)
|
43
|
+
state = response.dig(:property_address, :state)
|
44
|
+
zip = response.dig(:property_address, :zip)
|
37
45
|
full_address = "#{addr}, #{city}, #{state}, #{zip}"
|
38
46
|
MelissaData::GeoLookup::Geocoder
|
39
47
|
.address_to_coordinates(full_address)
|
data/melissa_data.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.bindir = "exe"
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
|
+
spec.required_ruby_version = '>= 2.3'
|
21
22
|
|
22
23
|
spec.add_runtime_dependency "nokogiri"
|
23
24
|
spec.add_runtime_dependency "rest-client"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: melissa_data
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Grayson
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -133,7 +133,8 @@ extra_rdoc_files: []
|
|
133
133
|
files:
|
134
134
|
- ".gitignore"
|
135
135
|
- ".rspec"
|
136
|
-
- ".
|
136
|
+
- ".ruby-gemset"
|
137
|
+
- ".ruby-version"
|
137
138
|
- ".travis.yml"
|
138
139
|
- CHANGELOG
|
139
140
|
- CODE_OF_CONDUCT.md
|
@@ -169,7 +170,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
169
170
|
requirements:
|
170
171
|
- - ">="
|
171
172
|
- !ruby/object:Gem::Version
|
172
|
-
version: '
|
173
|
+
version: '2.3'
|
173
174
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
174
175
|
requirements:
|
175
176
|
- - ">="
|
@@ -177,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
178
|
version: '0'
|
178
179
|
requirements: []
|
179
180
|
rubyforge_project:
|
180
|
-
rubygems_version: 2.
|
181
|
+
rubygems_version: 2.6.12
|
181
182
|
signing_key:
|
182
183
|
specification_version: 4
|
183
184
|
summary: A simple interface to Melissa Data's Web Smart Property API
|
data/.ruby_version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.2.1
|