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 CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -12,7 +12,7 @@ module PostcodeAnywhere
12
12
  yield self
13
13
  end
14
14
 
15
- class PostcodeSearch
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
- options={ "SearchTerm" => postcode }
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} )
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{ruby-postcodeanywhere}
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Chris Norman}]
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.0
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: -1344843909362846500
106
+ hash: -112573503192153481
107
107
  segments:
108
108
  - 0
109
109
  version: "0"