ruby-postcodeanywhere 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/ruby-postcodeanywhere.rb +5 -4
- data/ruby-postcodeanywhere.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -12,7 +12,7 @@ module PostcodeAnywhere
|
|
12
12
|
yield self
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
module PostcodeSearch
|
16
16
|
include HTTParty
|
17
17
|
|
18
18
|
base_uri 'https://services.postcodeanywhere.co.uk/PostcodeAnywhere/Interactive'
|
@@ -20,11 +20,12 @@ module PostcodeAnywhere
|
|
20
20
|
ADDRESS_LOOKUP = "/Find/v1.10/xmla.ws"
|
21
21
|
ADDRESS_FETCH = "/RetrieveById/v1.20/xmla.ws"
|
22
22
|
RETRIEVE_BY_PARTS_URL = "/RetrieveByParts/v1.00/xmla.ws"
|
23
|
-
|
24
|
-
format :xml
|
25
23
|
|
26
24
|
def lookup(postcode)
|
27
|
-
|
25
|
+
|
26
|
+
raise "Postcode is Required" if postcode.blank? || postcode.nil?
|
27
|
+
|
28
|
+
options={ "SearchTerm" => postcode.gsub(/\s/, '') }
|
28
29
|
options.merge!(self.license_information)
|
29
30
|
|
30
31
|
data = PostcodeSearch.get( ADDRESS_LOOKUP, {:query => options} )
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ruby-postcodeanywhere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Chris Norman
|
@@ -103,7 +103,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
103
103
|
requirements:
|
104
104
|
- - ">="
|
105
105
|
- !ruby/object:Gem::Version
|
106
|
-
hash: -
|
106
|
+
hash: -112573503192153481
|
107
107
|
segments:
|
108
108
|
- 0
|
109
109
|
version: "0"
|