Class: FrederickAPI::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/frederick_api/configuration.rb

Overview

You may use ‘FrederickAPI.configure` to configure the Frederick Internal API Gem or you can use environment variables. By default, the client will connect to staging with a blank API key.

See Also:

Constant Summary collapse

DEFAULTS =
{
  base_url: ENV['FREDERICK_API_BASE_URL'] ||
    'https://api.staging.hirefrederick.com',
  public_base_url: ENV['FREDERICK_API_PUBLIC_BASE_URL'] ||
    'https://api.public.staging.hirefrederick.com',
  api_key: ENV['FREDERICK_API_KEY']
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



23
24
25
26
27
# File 'lib/frederick_api/configuration.rb', line 23

def initialize
  @base_url = DEFAULTS[:base_url]
  @public_base_url = DEFAULTS[:public_base_url]
  @api_key = DEFAULTS[:api_key]
end

Instance Attribute Details

#api_keyObject

Returns the value of attribute api_key.



21
22
23
# File 'lib/frederick_api/configuration.rb', line 21

def api_key
  @api_key
end

#base_urlObject

Returns the value of attribute base_url.



21
22
23
# File 'lib/frederick_api/configuration.rb', line 21

def base_url
  @base_url
end

#public_base_urlObject

Returns the value of attribute public_base_url.



21
22
23
# File 'lib/frederick_api/configuration.rb', line 21

def public_base_url
  @public_base_url
end