addressfinder 1.5.2 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 05ba956f56eb4abdf67174b1c8dc8fa60e429855
4
- data.tar.gz: 473d3c098ab85f3255409d42fc114dbbddd278bf
2
+ SHA256:
3
+ metadata.gz: a2191b3d7090b6eb2c2001f080427cc917c5af00262520c907b401a2a3d7c82e
4
+ data.tar.gz: bd35444c4cb2a31a47130ded4dae80596718a4d6998006ffc34b92512cf729dd
5
5
  SHA512:
6
- metadata.gz: 9056caa0b3632c4069dc0f78fea84c876fa3fda0438af6cd771bee2a09aab93087e912decf5eabf923b442994360ec09c063f62d014ea86dd959be1dbf031082
7
- data.tar.gz: 0d20f2503daaeed9e724231973414731e65bfa4aa468f37ad7dadd059b226832bdf0f1ac3eadd49fbc395dc746cf5887e092e98691e9aa09ff4473764c1cba24
6
+ metadata.gz: '08384b27d66dd5397f8e07dc550b86ea0befa4eaae6f8f294dcb8f01e4372739bebfe0484a6874fd0f3f05b6f19ed21108e7923fd8416379532d5b799bb5c60f'
7
+ data.tar.gz: aadab0cc138ef723af46bd2e6baf1ac6571f51ecaba2dcfa2aedd34ff44b3a5c44b78f39ca5c2828edea29ae3329f1e22ec8ddfdc787482c24142202ece4b749
data/.travis.yml CHANGED
@@ -1,4 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.1.2
4
- - 2.2.3
3
+ - 2.2.7
4
+ - 2.3.1
5
+ - 2.4.1
6
+ - 2.6.3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ # AddressFinder 1.7.1 (June 2, 2021) #
2
+
3
+ * Add support for PAF verification
4
+ * Rename cleanse to verification
5
+
6
+ # AddressFinder 1.7.0 (May 4, 2020) #
7
+
8
+ * Add support for Address Autocomplete API (Australia only)
9
+
10
+ # AddressFinder 1.6.2 (September 23, 2019) #
11
+
12
+ * Add support for an optional state_codes parameter in the Cleanse class
13
+
14
+ # AddressFinder 1.6.1 (January 14, 2019) #
15
+
16
+ * Add support for an optional census parameter in the Cleanse class
17
+
18
+ # AddressFinder 1.6.0 (August 10, 2017) #
19
+
20
+ * Add support for a configurable number of request retries
21
+
1
22
  # AddressFinder 1.5.2 (December 21, 2015) #
2
23
 
3
24
  * Update for the nested response format used in Address Cleanse Australia
data/Dockerfile ADDED
@@ -0,0 +1,28 @@
1
+ # Use the barebones version of Ruby 2.6.1
2
+ FROM ruby:2.6
3
+
4
+ # Install dependencies:
5
+ # - build-essential: To ensure certain gems can be compiled
6
+ # - nodejs: Compile assets
7
+ # - bundler: ensure most recent version is installed
8
+ RUN apt-get update && apt-get install -qq -y build-essential --fix-missing --no-install-recommends
9
+ RUN gem install bundler
10
+
11
+ # Set an environment variable to store where the app is installed to inside
12
+ # of the Docker image.
13
+ ENV LANG C.UTF-8
14
+ ENV BUNDLE_PATH /bundle
15
+ ENV INSTALL_PATH /addressfinder-ruby
16
+ RUN mkdir -p $INSTALL_PATH
17
+
18
+ # Create address verification directories
19
+ RUN mkdir -p $INSTALL_PATH/verification/originals
20
+ RUN mkdir -p $INSTALL_PATH/verification/verified
21
+
22
+ # This sets the context of where commands will be ran in and is documented
23
+ # on Docker's website extensively.
24
+ WORKDIR $INSTALL_PATH
25
+
26
+ ADD . $INSTALL_PATH
27
+
28
+ RUN bundle install
data/Guardfile CHANGED
@@ -1,4 +1,4 @@
1
- guard :rspec, cmd: 'rspec' do
1
+ guard :rspec, cmd: 'bundle exec rspec' do
2
2
  watch(%r{^spec/.+_spec\.rb$})
3
3
  watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
4
4
  watch('spec/spec_helper.rb') { "spec" }
data/LICENSE.md ADDED
@@ -0,0 +1,15 @@
1
+ Copyright (c) 2015-present AddressFinder
2
+
3
+ The intellectual property rights in this plugin are owned by AddressFinder Limited of Wellington New Zealand (referred to below as “we”, “us” or “our”) or its third party licensors. The plugin may be accessed and used by AddressFinder customers only, subject to the following terms. If you are not, or are no longer, an AddressFinder customer you are not permitted to access or use the plugin in any way.
4
+
5
+ If you are an AddressFinder customer (referred to below as “you” or “your”), the following terms apply in relation to your access and use of the plugin (and your access or use of the plugin confirms your acceptance of the following terms). If you do not accept the following terms you are not permitted to access or use the plugin in any way.
6
+ * In these terms, “Terms and Conditions” means the applicable Terms and Conditions that you entered into, being either https://addressfinder.nz/legal/terms/ or https://addressfinder.com.au/legal/terms/, and “Services” and “Subscription Term” have the meaning given in the Terms and Conditions.
7
+ * All rights, title and interest (including, without limitation, all intellectual property rights) in and to the plugin are owned by us or our third party licensors. Provided that you comply with these terms, and the Terms and Conditions, we grant you the right during your Subscription Term to: (a) access and use the plugin solely in connection with the Services and then only in combination with websites that you own or control; and (b) view the source code and configurations of the plugin solely for the purpose of evaluating the plugin in relation to its use in connection with the Services, and for no other purpose. This right is non-exclusive, non-transferable and may be revoked by us at any time. You are not granted any other rights or licences in relation to the plugin.
8
+ * You must never copy, modify, publish, merge, distribute, resell, lease, transfer or sub-license, or create derivative works from, all or any part of the plugin. You must never access or use the plugin for any purpose related to building a product or service which competes with the Services or the plugin or has similar features or functionality. You must comply with all instructions or restrictions that we provide to you in relation to the plugin (including, without limitation, that we may post on this page from time to time).
9
+ * The plugin is provided to you on an "as is" and "as available" basis and your use of it is at your sole risk. To the maximum extent permitted by law, we do not represent or warrant that the plugin will be secure, reliable, uninterrupted, always available, free of errors, omissions, inaccuracies, viruses or other destructive code, or that it will be fit for your purposes or for use in any specific technical environment or that any problems can or will be corrected. To the maximum extent permitted by law, we give no warranties in relation to the plugin. To avoid doubt, to the maximum extent permitted by law, we disclaim and exclude all implied representations, warranties and conditions (including any warranties of fitness for purpose, merchantability, title and non-infringement). Certain legislation may imply warranties or conditions, impose obligations or give statutory guarantees (together, Statutory Provisions) which cannot be excluded, restricted or modified except to a limited extent. These terms must be read subject to applicable Statutory Provisions. If the Statutory Provisions apply, notwithstanding any other provision of these terms, to the extent to which we are entitled to do so, we limit our liability in respect of any claim to: (a) in the case of goods, at our option: the replacement of the goods or the supply of equivalent goods; the repair of the goods; the payment of the cost of replacing the goods or acquiring equivalent goods; or the payment of having the goods repaired; and (b) in the case of services, at our option: the supply of the services again; or the payment of the cost of having the services supplied again. If you entered into our New Zealand Terms and Conditions, you represent to us that you are acquiring the right to use the plugin for the purposes of a business and so you agree that the provisions of the Consumer Guarantees Act 1993 do not apply to the plugin.
10
+ * To the maximum extent permitted by law, we and Our Related Parties will not be liable to you or any third party for any loss or damage to data, breach of security, loss of profit, revenue, opportunity or saving, or any incidental, indirect, special or consequential loss or damage. To the maximum extent permitted by law, the total aggregate liability of us and Our Related Parties (together) to you under or in connection with these terms or its subject matter is limited to NZ$10. These limitations and exclusions of liability apply however liability arises, whether in contract, in tort (including negligence), for breach of statutory duty or otherwise. You fully indemnify us from and against any claim, proceeding, damage, loss, liability, cost or expense (including legal costs on a solicitor and own client basis) arising from or connected to your use of plugin or breach of these terms. In these terms “Our Related Parties” means AddressFinder Pty Limited, ACN 606 672 333, any related company of us or AddressFinder Pty Limited (where “related company” has the meaning given in section 2(3) of the Companies Act 1993, and includes any company or similar entity which would be a related company within that definition if incorporated as a company in New Zealand) and our suppliers, contractors, directors, employees and agents.
11
+ * We may change these terms at any time by emailing you, by updating the Terms and Conditions and/or by displaying or referring to the replacement terms on this page. Your continued use of the plugin after you receive notice of any such changes will amount to your acceptance of those changes. If you don’t accept those changes you must immediately stop using the plugin.
12
+ * Any waiver of any part of these terms must be in writing and signed by one of our authorised representatives. Any delay or failure by us to exercise any right does not prevent us from exercising that right, or any other right, on that or any other occasion.
13
+ * Any unlawful or unenforceable provision of these terms will be deemed to be amended to the minimum extent necessary to ensure that it is not unlawful or unenforceable and, as far as is possible, to ensure that it is consistent with the intent and effect of the provision. The remaining provisions will be enforceable as if such unlawful or unenforceable provision had not been included in these terms. If the provision is unable to be amended without materially altering the intent and effect of the provision, it will be severed, and the remaining provisions will be enforceable.
14
+ * The terms are governed by the laws of New Zealand and you and we submit to the non-exclusive jurisdiction of the New Zealand courts.
15
+
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # AddressFinder Ruby Gem
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/addressfinder.svg)](http://badge.fury.io/rb/addressfinder)
4
- [![Build Status](https://travis-ci.org/AbleTech/addressfinder-ruby.svg)](https://travis-ci.org/AbleTech/addressfinder-ruby)
4
+ [![Build Status](https://travis-ci.com/github/AddressFinder/addressfinder-ruby.svg)](https://travis-ci.com/github/AddressFinder/addressfinder-ruby)
5
5
 
6
- A client library for accessing the AddressFinder APIs.
6
+ A client library for accessing the [AddressFinder](https://addressfinder.nz/?utm_source=github&utm_medium=readme&utm_campaign=addressfinder_rubygem&utm_term=AddressFinder) APIs.
7
7
 
8
8
  ## Installation
9
9
 
@@ -19,43 +19,44 @@ Or install it yourself as:
19
19
 
20
20
  $ gem install addressfinder
21
21
 
22
- ## Usage
23
-
24
- ### Configuration
22
+ ## Configuration
25
23
 
26
- You should call the configure block on startup of your app. In a Ruby on Rails application this
27
- is normally performed in an initializer file. For example `./config/initializers/addressfinder.rb`
24
+ Use the configure block to set your `api_key` and `api_secret`.
28
25
 
29
26
  ```ruby
30
27
  AddressFinder.configure do |af|
31
- # Mandatory configuration
28
+ # Required
32
29
  af.api_key = 'XXXXXXXXXX'
33
30
  af.api_secret = 'YYYYYYYYYY'
34
- af.default_country = 'nz'
35
31
 
36
- # Optional configuration
37
- af.timeout = 10 # seconds
38
- af.proxy_host = 'corp.proxy.com'
32
+ # Optional
33
+ af.default_country = 'nz' # default: nz
34
+ af.timeout = 10 # default: 10 seconds
35
+ af.retries = 12 # default: 12
36
+ af.retry_delay = 5 # default: 5 seconds
37
+ af.domain = 'yourdomain.com'
38
+ af.proxy_host = 'yourproxy.com'
39
39
  af.proxy_port = 8080
40
40
  af.proxy_user = 'username'
41
41
  af.proxy_password = 'password'
42
- af.domain = 'myserver.mycompany.co.nz'
43
42
  end
44
43
  ```
45
44
 
46
- You can obtain your API key and secret from the AddressFinder Portal.
45
+ **_Don't know your key and secret?_**
46
+ *Login to the [AddressFinder portal](https://portal.addressfinder.io/?utm_source=github&utm_medium=readme&utm_campaign=addressfinder_rubygem&utm_term=AddressFinder%20Portal) to obtain your key and secret.*
47
47
 
48
- ### Address Cleansing
48
+ **_For Ruby on Rails:_**
49
+ *The configure block is best placed in an initializer file (`./config/initializers/addressfinder.rb`).*
49
50
 
50
- See the documentation on the available parameters and expected response here:
51
+ ## Usage
51
52
 
52
- https://addressfinder.nz/docs/address_cleanse_api/
53
- https://addressfinder.com.au/docs/address_cleanse_api/
53
+ For available parameters and example responses, see the API documentation pages for [New Zealand](https://addressfinder.nz/docs?utm_source=github&utm_medium=readme&utm_campaign=addressfinder_rubygem&utm_term=New%20Zealand) or [Australia](https://addressfinder.com.au/docs?utm_source=github&utm_medium=readme&utm_campaign=addressfinder_rubygem&utm_term=Australia).
54
54
 
55
- Usage example:
55
+
56
+ #### Address Verification
56
57
 
57
58
  ```ruby
58
- result = AddressFinder.cleanse(q: '186 Willis St, Wellington', country: 'nz')
59
+ result = AddressFinder.verification(q: '186 Willis St, Wellington', country: 'nz')
59
60
 
60
61
  if result
61
62
  $stdout.puts "Success: #{result.postal}"
@@ -64,107 +65,110 @@ else
64
65
  end
65
66
  ```
66
67
 
67
- ### Location Search
68
+ **Note:** The deprecated method `cleanse` is still available now but will be dropped in the future.
68
69
 
69
- See documentation on the available parameters and expected response here:
70
+ #### Address Search
70
71
 
71
- https://addressfinder.nz/docs/location_api/
72
+ The Address Search API supports the following address sets:
72
73
 
73
- Usage example:
74
+ * New Zealand addresses
75
+ * Australian addresses from the GNAF dataset only
74
76
 
75
77
  ```ruby
76
78
  begin
77
- results = AddressFinder.location_search(q: 'Queen Street')
79
+ results = AddressFinder.address_search(q: '186 Willis Street')
78
80
  if results.any?
79
- $standout.puts "Success: #{results}"
81
+ $stdout.puts "Success: #{results}"
80
82
  else
81
- $standout.puts "Sorry, there were no location matches"
83
+ $stdout.puts "Sorry, there were no address matches"
82
84
  end
83
85
  rescue AddressFinder::RequestRejectedError => e
84
86
  response = JSON.parse(e.body)
85
- $standout.puts response['message']
87
+ $stdout.puts response['message']
86
88
  end
87
89
  ```
88
90
 
89
- ### Location Info
90
-
91
- See documentation on the available parameters and expected response here:
91
+ #### Address Autocomplete
92
92
 
93
- https://addressfinder.nz/docs/location_info_api/
93
+ The Address Autocomplete API supports the following address sets:
94
94
 
95
- Usage example:
95
+ * Australian addresses from the GNAF and PAF datasets only
96
96
 
97
97
  ```ruby
98
98
  begin
99
- result = AddressFinder.location_info(pxid: '1-.B.3l')
100
- if result
101
- $standout.puts "Success: #{result.a}"
99
+ results = AddressFinder.address_autocomplete(q: '275 high st, bel', au_paf: '1')
100
+ if results.any?
101
+ $stdout.puts "Success: #{results}"
102
102
  else
103
- $standout.puts "Sorry, can't find that location"
103
+ $stdout.puts "Sorry, there were no address matches"
104
104
  end
105
105
  rescue AddressFinder::RequestRejectedError => e
106
106
  response = JSON.parse(e.body)
107
- $standout.puts response['message']
107
+ $stdout.puts response['message']
108
108
  end
109
109
  ```
110
110
 
111
- ### Address Search
111
+ #### Address Metadata
112
112
 
113
- See documentation on the available parameters and expected response here:
114
-
115
- https://addressfinder.nz/docs/address_api/
113
+ ```ruby
114
+ begin
115
+ result = AddressFinder.address_info(pxid: '1-.B.3l')
116
+ if result
117
+ $stdout.puts "Success: #{result.a}"
118
+ else
119
+ $stdout.puts "Sorry, can't find that address"
120
+ end
121
+ rescue AddressFinder::RequestRejectedError => e
122
+ response = JSON.parse(e.body)
123
+ $stdout.puts response['message']
124
+ end
125
+ ```
116
126
 
117
- Usage example:
127
+ #### Location Autocomplete
118
128
 
119
129
  ```ruby
120
130
  begin
121
- results = AddressFinder.address_search(q: '186 Willis Street')
131
+ results = AddressFinder.location_search(q: 'Queen Street')
122
132
  if results.any?
123
- $standout.puts "Success: #{results}"
133
+ $stdout.puts "Success: #{results}"
124
134
  else
125
- $standout.puts "Sorry, there were no address matches"
135
+ $stdout.puts "Sorry, there were no location matches"
126
136
  end
127
137
  rescue AddressFinder::RequestRejectedError => e
128
138
  response = JSON.parse(e.body)
129
- $standout.puts response['message']
139
+ $stdout.puts response['message']
130
140
  end
131
141
  ```
132
142
 
133
- ### Address Info
134
-
135
- See documentation on the available parameters and expected response here:
136
-
137
- https://addressfinder.nz/docs/address_info_api/
138
-
139
- Usage example:
143
+ #### Location Metadata
140
144
 
141
145
  ```ruby
142
146
  begin
143
- result = AddressFinder.address_info(pxid: '1-.B.3l')
147
+ result = AddressFinder.location_info(pxid: '1-.B.3l')
144
148
  if result
145
- $standout.puts "Success: #{result.a}"
149
+ $stdout.puts "Success: #{result.a}"
146
150
  else
147
- $standout.puts "Sorry, can't find that address"
151
+ $stdout.puts "Sorry, can't find that location"
148
152
  end
149
153
  rescue AddressFinder::RequestRejectedError => e
150
154
  response = JSON.parse(e.body)
151
- $standout.puts response['message']
155
+ $stdout.puts response['message']
152
156
  end
153
157
  ```
154
158
 
155
- ### Bulk Operations
159
+ ## Advanced Usage
156
160
 
157
- If you have a series of calls you need to make to AddressFinder, you can use the
158
- bulk method which re-uses the HTTP connection.
161
+ #### Bulk Operations
159
162
 
160
- The bulk method is only available for #cleanse operation.
163
+ If you have a series of API requests, you can use the
164
+ bulk method to re-use the HTTP connection.
161
165
 
162
- Usage example:
166
+ **Note:** The bulk method is currently only available for Address Verification (`#verification`).
163
167
 
164
168
  ```ruby
165
169
  AddressFinder.bulk do |af|
166
170
  CSV.foreach('auckland_addresses.csv') do |row|
167
- result = af.cleanse(q: row[0], region_code: '1')
171
+ result = af.verification(q: row[0], region_code: '1')
168
172
 
169
173
  if result
170
174
  $stdout.puts "Success: #{result.postal}"
@@ -175,34 +179,31 @@ AddressFinder.bulk do |af|
175
179
  end
176
180
  ```
177
181
 
178
- ## Advanced Usage
179
-
180
- ### Key and Secret Override
181
-
182
- What if you want to use another acccount for a specific query using the AddressFinder gem in your ruby app?
183
-
184
- You can override the `api_key` and `api_secret` set in the AddressFinder.configure block in `./config/initializers/addressfinder.rb` when using the AddressFinder gem.
185
182
 
186
- Those AddressFinder methods accept `:key` and `:secret` arguments:
187
- - `#cleanse`,
188
- - `#location_search`,
189
- - `#location_info`,
190
- - `#address_search`
191
- - `#address_info`
183
+ #### Key and Secret override
192
184
 
193
- Usage example:
185
+ What if you want to use another account for a specific query? You can override the `api_key` and `api_secret`.
194
186
 
195
187
  ```ruby
196
188
  begin
197
189
  result = AddressFinder.address_info(pxid: '1-.B.3l', key: 'AAAAAAAAAAAAA', secret: 'BBBBBBBBBBBBB')
198
190
  if result
199
- $standout.puts "Success: #{result.a}"
191
+ $stdout.puts "Success: #{result.a}"
200
192
  else
201
- $standout.puts "Sorry, can't find that address"
193
+ $stdout.puts "Sorry, can't find that address"
202
194
  end
203
195
  rescue AddressFinder::RequestRejectedError => e
204
196
  response = JSON.parse(e.body)
205
- $standout.puts response['message']
197
+ $stdout.puts response['message']
206
198
  end
207
199
  ```
208
200
 
201
+ ### Testing
202
+
203
+ You can run all the specs with the following command:
204
+
205
+ `docker-compose up`
206
+
207
+ You can `guard` for repeating test runs (while editing new code):
208
+
209
+ `docker-compose run ruby bundle exec guard`
@@ -5,11 +5,11 @@ Gem::Specification.new do |gem|
5
5
  gem.name = "addressfinder"
6
6
  gem.version = AddressFinder::VERSION
7
7
  gem.licenses = ['MIT']
8
- gem.authors = ["Nigel Ramsay", "Naiki Pohe", "Sean Arnold", "Alexandre Barret"]
9
- gem.email = ["nigel.ramsay@abletech.co.nz", "naiki.pohe@abletech.co.nz", "seanarnie@gmail.com", "alex@abletech.nz"]
8
+ gem.authors = ["Nigel Ramsay", "Naiki Pohe", "Sean Arnold", "Alexandre Barret", "Cassandre Guinut"]
9
+ gem.email = ["nigel.ramsay@addressfinder.nz", "naiki.pohe@abletech.co.nz", "seanarnie@gmail.com", "alex@abletech.nz", "cassandre.guinut@addressfinder.nz"]
10
10
  gem.description = %q{Ruby client library for AddressFinder}
11
11
  gem.summary = %q{Provides easy access to AddressFinder APIs}
12
- gem.homepage = "https://github.com/AbleTech/addressfinder-ruby"
12
+ gem.homepage = "https://github.com/AddressFinder/addressfinder-ruby"
13
13
 
14
14
  gem.files = `git ls-files`.split($/)
15
15
  gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
@@ -20,6 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.add_dependency 'multi_json', '~> 1.11'
21
21
  gem.add_development_dependency 'rspec', '~> 3.3'
22
22
  gem.add_development_dependency 'guard-rspec', '~> 4.6'
23
- gem.add_development_dependency 'rake', '~> 10.4'
23
+ gem.add_development_dependency 'rake', '~> 13.0'
24
24
  gem.add_development_dependency 'webmock', '~> 1.21'
25
+ gem.add_development_dependency 'listen', '~> 3.2'
25
26
  end
@@ -0,0 +1,11 @@
1
+ version: '3'
2
+ services:
3
+ ruby:
4
+ build: .
5
+ volumes:
6
+ - .:/addressfinder-ruby
7
+ - bundle-cache:/bundle
8
+ command: bundle exec rspec
9
+
10
+ volumes:
11
+ bundle-cache: {}
data/lib/addressfinder.rb CHANGED
@@ -1,15 +1,16 @@
1
- require 'net/http'
2
1
  require 'multi_json'
3
2
  require 'addressfinder/version'
4
3
  require 'addressfinder/configuration'
5
- require 'addressfinder/cleanse'
4
+ require 'addressfinder/verification'
6
5
  require 'addressfinder/location_info'
7
6
  require 'addressfinder/location_search'
8
7
  require 'addressfinder/address_info'
9
8
  require 'addressfinder/address_search'
9
+ require 'addressfinder/address_autocomplete'
10
10
  require 'addressfinder/bulk'
11
11
  require 'addressfinder/errors'
12
12
  require 'addressfinder/util'
13
+ require 'addressfinder/http'
13
14
 
14
15
  module AddressFinder
15
16
  class << self
@@ -27,42 +28,36 @@ module AddressFinder
27
28
  @configuration ||= AddressFinder::Configuration.new
28
29
  end
29
30
 
30
- def cleanse(args={})
31
- AddressFinder::Cleanse.new(args.merge(http: configure_http)).perform.result
31
+ def cleanse(args={}) # We are keeping this method for backward compatibility
32
+ AddressFinder::Verification.new(args.merge(http: AddressFinder::HTTP.new(configuration))).perform.result
33
+ end
34
+
35
+ def verification(args={})
36
+ AddressFinder::Verification.new(args.merge(http: AddressFinder::HTTP.new(configuration))).perform.result
32
37
  end
33
38
 
34
39
  def location_search(args={})
35
- AddressFinder::LocationSearch.new(params: args, http: configure_http).perform.results
40
+ AddressFinder::LocationSearch.new(params: args, http: AddressFinder::HTTP.new(configuration)).perform.results
36
41
  end
37
42
 
38
43
  def location_info(args={})
39
- AddressFinder::LocationInfo.new(params: args, http: configure_http).perform.result
44
+ AddressFinder::LocationInfo.new(params: args, http: AddressFinder::HTTP.new(configuration)).perform.result
40
45
  end
41
46
 
42
47
  def address_search(args={})
43
- AddressFinder::AddressSearch.new(params: args, http: configure_http).perform.results
48
+ AddressFinder::AddressSearch.new(params: args, http: AddressFinder::HTTP.new(configuration)).perform.results
44
49
  end
45
50
 
46
- def address_info(args={})
47
- AddressFinder::AddressInfo.new(params: args, http: configure_http).perform.result
51
+ def address_autocomplete(args={})
52
+ AddressFinder::AddressAutocomplete.new(params: args, http: AddressFinder::HTTP.new(configuration)).perform.results
48
53
  end
49
54
 
50
- def bulk(&block)
51
- # TODO include parameter http: configure_http
52
- AddressFinder::Bulk.new(&block).perform
55
+ def address_info(args={})
56
+ AddressFinder::AddressInfo.new(params: args, http: AddressFinder::HTTP.new(configuration)).perform.result
53
57
  end
54
58
 
55
- private
56
-
57
- def configure_http
58
- http = Net::HTTP.new(configuration.hostname, configuration.port,
59
- configuration.proxy_host, configuration.proxy_port,
60
- configuration.proxy_user, configuration.proxy_password)
61
- http.open_timeout = configuration.timeout
62
- http.read_timeout = configuration.timeout
63
- http.use_ssl = true
64
-
65
- http
59
+ def bulk(&block)
60
+ AddressFinder::Bulk.new(http: AddressFinder::HTTP.new(configuration), &block).perform
66
61
  end
67
62
  end
68
63
  end