module OiApi::Configuration

Constants

DEFAULT_API_ENDPOINT
DEFAULT_CONTENT_TYPE
DEFAULT_DEBUG_OUTPUT
DEFAULT_FORMAT
DEFAULT_USER_AGENT
VALID_CONFIG_KEYS

Public Class Methods

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

Public Instance Methods

configure() { |self| ... } click to toggle source
# File lib/oi_api/configuration.rb, line 25
def configure
  yield self
end
options() click to toggle source
# File lib/oi_api/configuration.rb, line 33
def options
  Hash[ *VALID_CONFIG_KEYS.map { |key| [key, public_send(key)] }.flatten ]
end
reset() click to toggle source
# File lib/oi_api/configuration.rb, line 37
def reset
  self.username      = nil
  self.password      = nil
  self.api_endpoint  = DEFAULT_API_ENDPOINT
  self.user_agent    = DEFAULT_USER_AGENT
  self.format        = DEFAULT_FORMAT
  self.content_type  = DEFAULT_CONTENT_TYPE
  self.debug_output  = DEFAULT_DEBUG_OUTPUT
end