Sha256: d3ea5652459351cdd3b3d47941d38fd447aed4aa69634fe8cf21539e03c64dcd

Contents?: true

Size: 990 Bytes

Versions: 16

Compression:

Stored size: 990 Bytes

Contents

module Loqate
  # Configuration for the gem
  class Configuration
    DEFAULT_LANGUAGE = 'en-gb'.freeze
    DEFAULT_HOST = 'https://api.addressy.com'.freeze

    # API key that will give you access to all services.
    #
    # @return [String]
    attr_reader :api_key

    # Base URL for Loqate's services. Defaults to https://api.addressy.com
    #
    # @return [String]
    attr_reader :host

    # Preferred language for results. This should be a 2 or 4 character language code e.g. (en, fr, en-gb, etc).
    #
    # @return [String]
    attr_reader :language

    # Instantiates the gem configuration
    #
    # @param [String] api_key API key that will give you access to all services
    # @param [String] host Base URL for Loqate's services
    # @param [String] language Preferred language for results
    #
    def initialize(api_key:, host: DEFAULT_HOST, language: DEFAULT_LANGUAGE)
      @api_key  = api_key
      @host     = host
      @language = language
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
loqate-0.12.0 lib/loqate/configuration.rb
loqate-0.11.1 lib/loqate/configuration.rb
loqate-0.11.0 lib/loqate/configuration.rb
loqate-0.10.4 lib/loqate/configuration.rb
loqate-0.10.3 lib/loqate/configuration.rb
loqate-0.10.2 lib/loqate/configuration.rb
loqate-0.10.1 lib/loqate/configuration.rb
loqate-0.10.0 lib/loqate/configuration.rb
loqate-0.9.0 lib/loqate/configuration.rb
loqate-0.8.0 lib/loqate/configuration.rb
loqate-0.7.0 lib/loqate/configuration.rb
loqate-0.6.0 lib/loqate/configuration.rb
loqate-0.5.0 lib/loqate/configuration.rb
loqate-0.4.0 lib/loqate/configuration.rb
loqate-0.3.0 lib/loqate/configuration.rb
loqate-0.2.0 lib/loqate/configuration.rb