Class: Loqate::Configuration
- Inherits:
-
Object
- Object
- Loqate::Configuration
- Defined in:
- lib/loqate/configuration.rb
Overview
Configuration for the gem
Constant Summary collapse
- DEFAULT_LANGUAGE =
'en-gb'.freeze
- DEFAULT_HOST =
'https://api.addressy.com'.freeze
Instance Attribute Summary collapse
-
#api_key ⇒ String
readonly
API key that will give you access to all services.
-
#host ⇒ String
readonly
Base URL for Loqate’s services.
-
#language ⇒ String
readonly
Preferred language for results.
Instance Method Summary collapse
-
#initialize(api_key:, host: DEFAULT_HOST, language: DEFAULT_LANGUAGE) ⇒ Configuration
constructor
Instantiates the gem configuration.
Constructor Details
#initialize(api_key:, host: DEFAULT_HOST, language: DEFAULT_LANGUAGE) ⇒ Configuration
Instantiates the gem configuration
28 29 30 31 32 |
# File 'lib/loqate/configuration.rb', line 28 def initialize(api_key:, host: DEFAULT_HOST, language: DEFAULT_LANGUAGE) @api_key = api_key @host = host @language = language end |
Instance Attribute Details
#api_key ⇒ String (readonly)
API key that will give you access to all services.
10 11 12 |
# File 'lib/loqate/configuration.rb', line 10 def api_key @api_key end |
#host ⇒ String (readonly)
Base URL for Loqate’s services. Defaults to api.addressy.com
15 16 17 |
# File 'lib/loqate/configuration.rb', line 15 def host @host end |
#language ⇒ String (readonly)
Preferred language for results. This should be a 2 or 4 character language code e.g. (en, fr, en-gb, etc).
20 21 22 |
# File 'lib/loqate/configuration.rb', line 20 def language @language end |