module Fixer::Configuration

Constants

DEFAULT_ADAPTER

Adapters are whatever Faraday supports - I like excon alot, so I’m defaulting it

DEFAULT_ENDPOINT

The api endpoint to get REST

DEFAULT_QUEUE

sqs queue to write messages

DEFAULT_USER_AGENT

The value sent in the http header for ‘User-Agent’ if none is set

VALID_OPTIONS_KEYS

Public Class Methods

extended(base) click to toggle source
# File lib/fixer/configuration.rb, line 34
def self.extended(base)
  base.reset!
end
keys() click to toggle source
# File lib/fixer/configuration.rb, line 39
def keys
  VALID_OPTIONS_KEYS
end

Public Instance Methods

configure() { |self| ... } click to toggle source

Convenience method to allow for global setting of configuration options

# File lib/fixer/configuration.rb, line 30
def configure
  yield self
end
options() click to toggle source
# File lib/fixer/configuration.rb, line 44
def options
  options = {}
  VALID_OPTIONS_KEYS.each { |k| options[k] = send(k) }
  options
end
reset!() click to toggle source

Reset configuration options to their defaults

# File lib/fixer/configuration.rb, line 51
def reset!
  self.client_id     = ENV['FIXER_CLIENT_ID']
  self.client_secret = ENV['FIXER_CLIENT_SECRET']
  self.adapter       = DEFAULT_ADAPTER
  self.endpoint      = ENV['FIXER_ENDPOINT'] || DEFAULT_ENDPOINT
  self.user_agent    = DEFAULT_USER_AGENT
  self.aws           = nil
  self.queue         = ENV['FIXER_QUEUE'] || DEFAULT_QUEUE
  self
end