module PostcodeAnywhere::Configuration

Constants

DEFAULT_API_KEY
DEFAULT_ENDPOINT
DEFAULT_FORMAT
DEFAULT_METHOD
DEFAULT_USER_AGENT
VALID_CONFIG_KEYS
VALID_CONNECTION_KEYS
VALID_OPTIONS_KEYS

Public Class Methods

extended(base) click to toggle source
# File lib/postcode_anywhere/configuration.rb, line 28
def self.extended(base)
  base.reset
end

Public Instance Methods

configure() { |self| ... } click to toggle source
# File lib/postcode_anywhere/configuration.rb, line 40
def configure
  yield self
end
options() click to toggle source

Return the configuration values set in this module

# File lib/postcode_anywhere/configuration.rb, line 45
def options
  Hash[* VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten]
end
reset() click to toggle source
# File lib/postcode_anywhere/configuration.rb, line 32
def reset
  self.api_key          = DEFAULT_API_KEY
  self.endpoint         = DEFAULT_ENDPOINT
  self.format           = DEFAULT_FORMAT
  self.method           = DEFAULT_METHOD
  self.user_agent       = DEFAULT_USER_AGENT
end