module BWAPI::Configuration

Configuration module

Attributes

access_token[RW]
access_token_expiry[RW]
adapter[RW]
api_endpoint[RW]
client_id[RW]
client_secret[RW]
debug[RW]
grant_type[RW]
logger[RW]
open_timeout[RW]
password[RW]
performance[RW]
refresh_token[RW]
timeout[RW]
user_agent[RW]
username[RW]
verify_ssl[RW]

Public Class Methods

keys() click to toggle source

Configuration keys

# File lib/bwapi/configuration.rb, line 12
def keys
  @keys ||= [
    :access_token,
    :access_token_expiry,
    :adapter,
    :api_endpoint,
    :client_id,
    :client_secret,
    :connection_options,
    :debug,
    :grant_type,
    :logger,
    :open_timeout,
    :password,
    :performance,
    :refresh_token,
    :timeout,
    :user_agent,
    :username,
    :verify_ssl
  ]
end

Public Instance Methods

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

Set configuration options using a block

# File lib/bwapi/configuration.rb, line 37
def configure
  yield self
end
destroy() click to toggle source
# File lib/bwapi/configuration.rb, line 46
def destroy
  BWAPI::Configuration.keys.each { |key| instance_variable_set(:"@#{key}", nil) }
  self
end
reset() click to toggle source
# File lib/bwapi/configuration.rb, line 41
def reset
  BWAPI::Configuration.keys.each { |key| instance_variable_set(:"@#{key}", BWAPI::Default.options[key]) }
  self
end

Private Instance Methods

options() click to toggle source
# File lib/bwapi/configuration.rb, line 55
def options
  Hash[BWAPI::Configuration.keys.map { |key| [key, instance_variable_get(:"@#{key}")] }]
end