postcodeanywhere 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/postcodeanywhere.rb +2 -2
- data/postcodeanywhere.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.6.0
|
data/lib/postcodeanywhere.rb
CHANGED
@@ -46,14 +46,14 @@ module PostcodeAnywhere
|
|
46
46
|
data = PostcodeSearch.get self.fetch_url
|
47
47
|
formatted_data = data["NewDataSet"]["Data"]
|
48
48
|
@address_lookup = AddressLookup.new
|
49
|
-
if
|
49
|
+
if self.country_code == 'GB'
|
50
50
|
@address_lookup.postcode = formatted_data["postcode"]
|
51
51
|
@address_lookup.address_line_1 = formatted_data["line1"]
|
52
52
|
@address_lookup.address_line_2 = formatted_data["line2"]
|
53
53
|
@address_lookup.address_line_3 = formatted_data["line3"]
|
54
54
|
@address_lookup.post_town = formatted_data["post_town"]
|
55
55
|
@address_lookup.county = formatted_data["county"].blank? ? formatted_data["post_town"] : formatted_data["county"]
|
56
|
-
elsif
|
56
|
+
elsif self.country_code == 'US'
|
57
57
|
@address_lookup.postcode = formatted_data["zip4"].blank? ? @postcode_search.postcode : formatted_data["zip4"]
|
58
58
|
@address_lookup.address_line_1 = formatted_data["line1"]
|
59
59
|
@address_lookup.address_line_2 = formatted_data["line2"]
|
data/postcodeanywhere.gemspec
CHANGED