module BlizzardApi::Configuration

Global configurations

Attributes

access_token[RW]

@!attribute access_token

Access token. Optional. If you don't provide one it will be generate using your client credentials.
@return [String] Access token.
app_id[RW]

@!attribute app_id

Application ID.
@see https://develop.battle.net/access/clients
@return [String] Application ID
app_secret[RW]

@!attribute app_secret

Application secret.
@see https://develop.battle.net/access/clients
@return [String] Application secret
concurrency[W]

@!attribute concurrency

How many threads to use for WoW game data `complete` payloads. Defaults to 4.
Should be set to the amount of available cores on the system.
@return [Integer] Concurrency
redis_host[RW]

@!attribute redis_host

Redis host.
@see https://redis.io/
@return [String] Redis host
redis_port[RW]

@!attribute redis_port

Redis port.
@see https://redis.io/
@return [Integer] Redis port
region[RW]

@!attribute region

Default region.
@return [String] Default region
use_cache[RW]

@!attribute use_cache

If true requests will be cached using a Redis server.
@see https://redis.io/
@return [Boolean] Application ID

Public Instance Methods

concurrency() click to toggle source
# File lib/blizzard_api/configuration.rb, line 86
def concurrency
  @concurrency ||= 4
end
configure() { |self| ... } click to toggle source

This method return the singleton instance of the configuration module. Use this to initialize the default values and options.

@yield self

@example

BlizzardApi.configure do |config|
  config.app_id = ENV['BNET_APPLICATION_ID']
  config.app_secret = ENV['BNET_APPLICATION_SECRET']
  config.region = 'us'

  config.use_cache = true
  config.redis_host = ENV['REDIS_HOST']
  config.redis_port = ENV['REDIS_PORT']
  config.format = :json

  config.icons_directory = './wow/icons'
  config.guild_crest_directory = './wow/guild_crest'
  config.wow_character_profile_directory = './wow/profile'
end
# File lib/blizzard_api/configuration.rb, line 82
def configure
  yield self
end