endpost 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dial_a_zip.rb +4 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 49828ac53ae6cc495875a688b649dc82a4fa09b0
4
- data.tar.gz: 393ed1e3a6a6cdb4d9eab9b225c03e7a6884d064
3
+ metadata.gz: f932ab9848e84f14ad57439fe75f867685fe851e
4
+ data.tar.gz: 0595844c10e7ce2350e1d965813773748247a83e
5
5
  SHA512:
6
- metadata.gz: 7b9389fbaae2e1d5b27fc688b7d61eaa6e7cca6ca7af99b54a50b7593a5b7a5b1ec3f9265bb81dc76adff299751ef96058820a639ac657e5d90b015a60359ec2
7
- data.tar.gz: 2d4397bc86f3f827ba7eb231f8c56c52eb7b7f94ada07cb7be0ff7ed9db39eb7a3abda927c07aaff863039d231b8afd991e408640755febf060121b427886c7d
6
+ metadata.gz: bb536ef581091822a796d45f6dfef4932c5b2a56cc8b495fbc4e1dd495713ff924399caed08d4ff813aa56c8467d21af85d7369a4dbe6564e8f5d50c42abeb4a
7
+ data.tar.gz: a5b2b2cb5421394ed2f31b8a89a899ced54e5107d040313d1c1062a3ade9b75298829b6d4d2be70da84bd31671613a93644e864289eb3dd3858a351ceb845545
@@ -13,6 +13,8 @@ module DialAZip
13
13
  '32' => 'More information, such as an apartment or suite number, may give a more specific address.',
14
14
  }
15
15
 
16
+ DIAL_A_ZIP_ADDRESS_NOT_FOUND_MESSAGE = 'The address as submitted could not be found'
17
+
16
18
  attr_accessor :dial_a_zip_user, :dial_a_zip_password
17
19
 
18
20
  def verify_address(address)
@@ -39,7 +41,7 @@ module DialAZip
39
41
  addr_exists_node_xml = response_xml.css('Dial-A-ZIP_Response AddrExists').first
40
42
  addr_exists = addr_exists_node_xml ? addr_exists_node_xml.text : nil
41
43
 
42
- if return_code == '31' && addr_exists == 'TRUE'
44
+ if ['31', '32'].include?(return_code) && addr_exists == 'TRUE'
43
45
  return {
44
46
  :full_name => response_xml.css('Dial-A-ZIP_Response AddrLine2').first.text,
45
47
  :address => response_xml.css('Dial-A-ZIP_Response AddrLine1').first.text,
@@ -48,7 +50,7 @@ module DialAZip
48
50
  :zipcode => [response_xml.css('Dial-A-ZIP_Response ZIP5').first.text, response_xml.css('Dial-A-ZIP_Response Plus4').first.text].join('-'),
49
51
  }
50
52
  else
51
- fail DIAL_A_ZIP_RESPONSE_MESSAGES[return_code]
53
+ fail return_code == '31' ? DIAL_A_ZIP_ADDRESS_NOT_FOUND_MESSAGE : DIAL_A_ZIP_RESPONSE_MESSAGES[return_code]
52
54
  end
53
55
 
54
56
  rescue => e
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: endpost
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alfonso Cora
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-10 00:00:00.000000000 Z
11
+ date: 2015-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client