Class: Loqate::Gateway

Inherits:
Object
  • Object
show all
Defined in:
lib/loqate/gateway.rb

Overview

Acts as a single point of entry for a defined group of API’s.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Gateway

Creates a new gateway.

Parameters:

  • options (Hash)

    Options to configure the gem.

Options Hash (**options):

  • :api_key (String)

    API key that will give you access to all services

  • :host (String)

    Base URL for Loqate’s services

  • :language (String)

    Preferred language for results

See Also:



25
26
27
28
# File 'lib/loqate/gateway.rb', line 25

def initialize(**options)
  @config = Configuration.new(**options)
  @client = Client.new(config)
end

Instance Attribute Details

#configConfiguration (readonly)

The gem configuration.

Returns:



14
15
16
# File 'lib/loqate/gateway.rb', line 14

def config
  @config
end

Instance Method Details

#addressAddress::Gateway

Gateway to the Address APIs.

Returns:



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

def address
  @address ||= Address::Gateway.new(client)
end

#bankBank::Gateway

Gateway to the Bank verification APIs.

Returns:



66
67
68
# File 'lib/loqate/gateway.rb', line 66

def bank
  @bank ||= Bank::Gateway.new(client)
end

#emailEmail::Gateway

Gateway to the Email verification APIs.

Returns:



58
59
60
# File 'lib/loqate/gateway.rb', line 58

def email
  @email ||= Email::Gateway.new(client)
end

#geocodingGeocoding::Gateway

Gateway to the Geocoding APIs.

Returns:



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

def geocoding
  @geocoding ||= Geocoding::Gateway.new(client)
end

#phonePhone::Gateway

Gateway to the Phone number API.

Returns:



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

def phone
  @phone ||= Phone::Gateway.new(client)
end