Class: AddressFinder::Bulk::ClientProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/addressfinder/bulk.rb

Instance Method Summary collapse

Constructor Details

#initialize(http:, verification_version:, default_country:) ⇒ ClientProxy

Returns a new instance of ClientProxy.



21
22
23
24
25
# File 'lib/addressfinder/bulk.rb', line 21

def initialize(http:, verification_version:, default_country:)
  @verification_version = verification_version
  @default_country = default_country
  @http = http
end

Instance Method Details

#cleanse(args = {}) ⇒ Object



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

def cleanse(args={})
  AddressFinder::Verification.new(**args.merge(http: http)).perform.result
end

#email_verification(args = {}) ⇒ Object



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

def email_verification(args={})
  AddressFinder::V1::Email::Verification.new(**args.merge(http: http)).perform.result
end

#phone_verification(args = {}) ⇒ Object



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

def phone_verification(args={})
  AddressFinder::V1::Phone::Verification.new(**args.merge(http: http)).perform.result
end

#verification(args = {}) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/addressfinder/bulk.rb', line 31

def verification(args={})
  if verification_version&.downcase == "v2" && (args[:country] || default_country) == 'au'
    AddressFinder::V2::Au::Verification.new(**args.merge(http: http)).perform.result
  else
    AddressFinder::Verification.new(**args.merge(http: http)).perform.result
  end
end