melissa_data 0.2.13 → 0.2.14

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9396713cb4f41daf6d74fd6ad64bbb080156eb20
4
- data.tar.gz: a38a780b35cf7badece913b9ccce0ab72dda97f5
3
+ metadata.gz: 06b64d5d7b8656d81ecf6c0b413cf4cbea7c9534
4
+ data.tar.gz: c02651c7504b10bda9ad1607e06bc99b9b257286
5
5
  SHA512:
6
- metadata.gz: 84c3a718b4bad198c785667ccc9e09891e8f0c5646513b3b247f20bf7fd9b1e65b4685bf736a7c8e772ef4931091987674c5db45b49410afe67c04ebc699c08e
7
- data.tar.gz: b0b50944871289d9e146fda85fd8026386f862f4128554be6c7e24ced3e4d75f44bf669aa09dee6335446c60439ae715e5d50e4e5eadccffc3894fb34c67a687
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(key: key)
64
+ irb> client.property_by_address_key(address_key: key)
65
65
  # => your property data
66
66
  ```
67
67
 
@@ -1,3 +1,3 @@
1
1
  module MelissaData
2
- VERSION = "0.2.13"
2
+ VERSION = "0.2.14"
3
3
  end
@@ -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
- { errors: codes_for(codes, resp_type, 'error') }
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'
@@ -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 = "http://github.com/cometaworks/melissa_data"
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.13
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-05-30 00:00:00.000000000 Z
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: http://github.com/cometaworks/melissa_data
161
+ homepage: https://github.com/accessterminal/melissa_data
162
162
  licenses:
163
163
  - MIT
164
164
  metadata: {}