Module: AddressFinder

Defined in:
lib/addressfinder.rb,
lib/addressfinder/bulk.rb,
lib/addressfinder/http.rb,
lib/addressfinder/util.rb,
lib/addressfinder/errors.rb,
lib/addressfinder/cleanse.rb,
lib/addressfinder/version.rb,
lib/addressfinder/address_info.rb,
lib/addressfinder/configuration.rb,
lib/addressfinder/location_info.rb,
lib/addressfinder/address_search.rb,
lib/addressfinder/location_search.rb

Defined Under Namespace

Classes: AddressInfo, AddressSearch, Bulk, Cleanse, Configuration, HTTP, LocationInfo, LocationSearch, NotFoundError, RequestRejectedError, Util

Constant Summary collapse

VERSION =
'1.6.2'

Class Method Summary collapse

Class Method Details

.address_info(args = {}) ⇒ Object


46
47
48
# File 'lib/addressfinder.rb', line 46

def address_info(args={})
  AddressFinder::AddressInfo.new(params: args, http: AddressFinder::HTTP.new(configuration)).perform.result
end

.address_search(args = {}) ⇒ Object


42
43
44
# File 'lib/addressfinder.rb', line 42

def address_search(args={})
  AddressFinder::AddressSearch.new(params: args, http: AddressFinder::HTTP.new(configuration)).perform.results
end

.bulk(&block) ⇒ Object


50
51
52
# File 'lib/addressfinder.rb', line 50

def bulk(&block)
  AddressFinder::Bulk.new(http: AddressFinder::HTTP.new(configuration), &block).perform
end

.cleanse(args = {}) ⇒ Object


30
31
32
# File 'lib/addressfinder.rb', line 30

def cleanse(args={})
  AddressFinder::Cleanse.new(args.merge(http: AddressFinder::HTTP.new(configuration))).perform.result
end

.configurationObject


26
27
28
# File 'lib/addressfinder.rb', line 26

def configuration
  @configuration ||= AddressFinder::Configuration.new
end

.configure(config_hash = nil) {|configuration| ... } ⇒ Object

Yields:


16
17
18
19
20
21
22
23
24
# File 'lib/addressfinder.rb', line 16

def configure(config_hash=nil)
  if config_hash
    config_hash.each do |k,v|
      configuration.send("#{k}=", v) rescue nil if configuration.respond_to?("#{k}=")
    end
  end

  yield(configuration) if block_given?
end

.location_info(args = {}) ⇒ Object


38
39
40
# File 'lib/addressfinder.rb', line 38

def location_info(args={})
  AddressFinder::LocationInfo.new(params: args, http: AddressFinder::HTTP.new(configuration)).perform.result
end

.location_search(args = {}) ⇒ Object


34
35
36
# File 'lib/addressfinder.rb', line 34

def location_search(args={})
  AddressFinder::LocationSearch.new(params: args, http: AddressFinder::HTTP.new(configuration)).perform.results
end