Sha256: 68d702b308ca648e12e68004788aefcef4fd4a55a14fa64771d7237b04ceabcb

Contents?: true

Size: 951 Bytes

Versions: 2

Compression:

Stored size: 951 Bytes

Contents

require 'loqate/address_gateway'

module Loqate
  # Acts as a single point of entry for a defined group of API's.
  class Gateway
    # The gem configuration.
    #
    # @return [Configuration]
    #
    attr_reader :config

    # Creates a new gateway.
    #
    # @param [Hash] options Options to configure the gem.
    # @option options [String] :api_key API key that will give you access to all services
    # @option options [String] :host Base URL for Loqate's services
    # @option options [String] :language Preferred language for results
    #
    # @see Configuration
    #
    def initialize(options)
      @config = Configuration.new(options)
      @client = Client.new(config)
    end

    # Gateway to the Address APIs.
    #
    # @return [AddressGateway] An instance of an address gateway.
    #
    def address
      @address ||= AddressGateway.new(client)
    end

    private

    # @api private
    attr_reader :client
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
loqate-0.3.0 lib/loqate/gateway.rb
loqate-0.2.0 lib/loqate/gateway.rb