Class: AddressFinder::V2::Au::Verification

Inherits:
Object
  • Object
show all
Defined in:
lib/addressfinder/v2/au/verification.rb

Defined Under Namespace

Classes: Result

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(q:, http:, post_box: nil, census: nil, domain: nil, key: nil, secret: nil, paf: nil, gnaf: nil, gps: nil, state_codes: nil, extended: nil, country: nil) ⇒ Verification

V2 AU expected attributes: params –> the address query, params –> nil or ‘0’ params –> ‘2011’ or ‘2016’ or nil, params –> used for reporting does not affect query results params –> unique AddressFinder public key params –> unique AddressFinder secret key params –> nil or ‘1’, params –> nil or ‘1’, params –> nil or ‘1’, params –> nil or ‘1’, params –> string or array of strings: i.e.,[‘ACT’, ‘NSW’],



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/addressfinder/v2/au/verification.rb', line 21

def initialize(q:, http:, post_box: nil, census: nil, domain: nil, key: nil, secret: nil, paf: nil, gnaf: nil,
  gps: nil, state_codes: nil, extended: nil, country: nil)
  @params = {}
  @params["q"] = q
  @params["post_box"] = post_box if post_box
  @params["census"] = census if census
  @params["domain"] = domain || config.domain if domain || config.domain
  @params["key"] = key || config.api_key
  @params["secret"] = secret || config.api_secret
  @params["paf"] = paf if paf
  @params["gnaf"] = gnaf if gnaf
  @params["gps"] = gps if gps
  @params["extended"] = extended if extended
  @params["state_codes"] = state_codes if state_codes

  @params["format"] = "json"
  @http = http
end

Instance Attribute Details

#resultObject

Returns the value of attribute result.



7
8
9
# File 'lib/addressfinder/v2/au/verification.rb', line 7

def result
  @result
end

Instance Method Details

#performObject



40
41
42
43
44
45
46
# File 'lib/addressfinder/v2/au/verification.rb', line 40

def perform
  build_request
  execute_request
  build_result

  self
end