module AylienTextApi::Configuration

Constants

DEFAULT_APP_ID
DEFAULT_APP_KEY
DEFAULT_BASE_URI
DEFAULT_METHOD
DEFAULT_USER_AGENT
ENDPOINTS
VALID_CONFIG_KEYS
VALID_CONNECTION_KEYS
VALID_OPTIONS_KEYS

Public Class Methods

extended(base) click to toggle source

Make sure we have the default values set when we get 'extended'

# File lib/aylien_text_api/configuration.rb, line 49
def self.extended(base)
  base.reset
end

Public Instance Methods

configure() { |self| ... } click to toggle source
# File lib/aylien_text_api/configuration.rb, line 62
def configure
  yield self
end
options() click to toggle source
# File lib/aylien_text_api/configuration.rb, line 66
def options
  Hash[ * VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten ]
end
reset() click to toggle source
# File lib/aylien_text_api/configuration.rb, line 53
def reset
  self.base_uri    = DEFAULT_BASE_URI
  self.method      = DEFAULT_METHOD
  self.user_agent  = DEFAULT_USER_AGENT

  self.app_id     = DEFAULT_APP_ID
  self.app_key    = DEFAULT_APP_KEY
end