melissa_data 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/melissa_data/version.rb +1 -1
- data/lib/melissa_data/web_smart/response_processor.rb +10 -1
- data/melissa_data.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 06b64d5d7b8656d81ecf6c0b413cf4cbea7c9534
|
4
|
+
data.tar.gz: c02651c7504b10bda9ad1607e06bc99b9b257286
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e4c669f5894d837f0740dc5872ad2c936fbf9c873b32923cc5dd1642929bd734e4d9e33d6fdbc9b1370dc0d763c6eaf644ba209b19bf513c4b0c6066b330530
|
7
|
+
data.tar.gz: 0b1fce5d39861a0accbc6b1136bddddd5330b215deebd03544deec9114c1065300480788fa05a892d686c4c9b6b1d8ad22860fd058b47e953a659284c3e4b1e4
|
data/README.md
CHANGED
@@ -61,7 +61,7 @@ irb> client.property_by_apn(apn: some_apn, fips: some_fips_code)
|
|
61
61
|
# You can also look up an address code and get its `address_key` instead of using
|
62
62
|
# an apn and fips code
|
63
63
|
irb> key = client.address(address: "508 n mulberry st", city: "clyde", state: "Ohio", zip: "43410")[:address_key]
|
64
|
-
irb> client.property_by_address_key(
|
64
|
+
irb> client.property_by_address_key(address_key: key)
|
65
65
|
# => your property data
|
66
66
|
```
|
67
67
|
|
data/lib/melissa_data/version.rb
CHANGED
@@ -7,7 +7,10 @@ module MelissaData
|
|
7
7
|
def process(response, resp_type)
|
8
8
|
codes = codes(response, resp_type)
|
9
9
|
if has_error_codes?(codes)
|
10
|
-
{
|
10
|
+
{
|
11
|
+
errors: codes_for(codes, resp_type, 'error'),
|
12
|
+
error_codes: map_codes_for(codes, resp_type, 'error')
|
13
|
+
}
|
11
14
|
else
|
12
15
|
response.merge!(success: codes_for(codes, resp_type, 'success'))
|
13
16
|
end
|
@@ -19,6 +22,12 @@ module MelissaData
|
|
19
22
|
end.compact
|
20
23
|
end
|
21
24
|
|
25
|
+
def map_codes_for(codes, resp_type, code_type)
|
26
|
+
codes.each_with_object([]) do |code, res|
|
27
|
+
res << { code: code.to_s, description: YAML.load(File.read("config/#{resp_type}_#{code_type}_codes.yml")).values.first[code.to_s] }
|
28
|
+
end.compact
|
29
|
+
end
|
30
|
+
|
22
31
|
def codes(response, resp_type)
|
23
32
|
case resp_type
|
24
33
|
when 'property'
|
data/melissa_data.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = %q{A simple interface to Melissa Data's Web Smart Property API}
|
13
13
|
spec.description = %q{A simple interface to Melissa Data's Web Smart Property API}
|
14
|
-
spec.homepage = "
|
14
|
+
spec.homepage = "https://github.com/accessterminal/melissa_data"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
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.14
|
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: 2017-
|
12
|
+
date: 2017-06-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -158,7 +158,7 @@ files:
|
|
158
158
|
- lib/melissa_data/web_smart/response_processor.rb
|
159
159
|
- lib/melissa_data/web_smart/xml.rb
|
160
160
|
- melissa_data.gemspec
|
161
|
-
homepage:
|
161
|
+
homepage: https://github.com/accessterminal/melissa_data
|
162
162
|
licenses:
|
163
163
|
- MIT
|
164
164
|
metadata: {}
|