Module: BlizzardApi::Configuration
- Included in:
- BlizzardApi
- Defined in:
- lib/blizzard_api_rb/configuration.rb
Overview
Global configurations
Instance Attribute Summary collapse
-
#app_id ⇒ String
Application ID.
-
#app_secret ⇒ String
Application secret.
-
#cache_access_token ⇒ Boolean
If set to true and cache is enabled the current access token will be cached and recovered from Redis.
-
#mode ⇒ Symbol
Api response mode :regular or :extended.
-
#redis_database ⇒ Integer
Redis databse.
-
#redis_host ⇒ String
Redis host.
-
#redis_port ⇒ Integer
Redis port.
-
#region ⇒ String
Default region.
-
#use_cache ⇒ Boolean
If true requests will be cached using a Redis server.
Class Method Summary collapse
-
.extended(base) ⇒ Object
Initializes some default values for the main module.
Instance Method Summary collapse
-
#configure { ... } ⇒ Object
This method return the singleton instance of the configuration module.
Instance Attribute Details
#app_id ⇒ String
Application ID.
11 12 13 |
# File 'lib/blizzard_api_rb/configuration.rb', line 11 def app_id @app_id end |
#app_secret ⇒ String
Application secret.
18 19 20 |
# File 'lib/blizzard_api_rb/configuration.rb', line 18 def app_secret @app_secret end |
#cache_access_token ⇒ Boolean
If set to true and cache is enabled the current access token will be cached and recovered from Redis
64 65 66 |
# File 'lib/blizzard_api_rb/configuration.rb', line 64 def cache_access_token @cache_access_token end |
#mode ⇒ Symbol
Api response mode :regular or :extended.
30 31 32 |
# File 'lib/blizzard_api_rb/configuration.rb', line 30 def mode @mode end |
#redis_database ⇒ Integer
Redis databse.
58 59 60 |
# File 'lib/blizzard_api_rb/configuration.rb', line 58 def redis_database @redis_database end |
#redis_host ⇒ String
Redis host.
44 45 46 |
# File 'lib/blizzard_api_rb/configuration.rb', line 44 def redis_host @redis_host end |
#redis_port ⇒ Integer
Redis port.
51 52 53 |
# File 'lib/blizzard_api_rb/configuration.rb', line 51 def redis_port @redis_port end |
#region ⇒ String
Default region.
24 25 26 |
# File 'lib/blizzard_api_rb/configuration.rb', line 24 def region @region end |
#use_cache ⇒ Boolean
If true requests will be cached using a Redis server.
37 38 39 |
# File 'lib/blizzard_api_rb/configuration.rb', line 37 def use_cache @use_cache end |
Class Method Details
.extended(base) ⇒ Object
Initializes some default values for the main module
88 89 90 91 |
# File 'lib/blizzard_api_rb/configuration.rb', line 88 def self.extended(base) base.redis_port = 1 base.mode = :regular end |
Instance Method Details
#configure { ... } ⇒ Object
This method return the singleton instance of the configuration module. Use this to initialize the default values and options.
82 83 84 |
# File 'lib/blizzard_api_rb/configuration.rb', line 82 def configure yield self end |