Class: Blinkist::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/blinkist/config.rb,
lib/blinkist/config/version.rb,
lib/blinkist/config/adapters/adapter.rb,
lib/blinkist/config/adapters/env_adapter.rb,
lib/blinkist/config/adapters/diplomat_adapter.rb

Defined Under Namespace

Classes: Adapter, DiplomatAdapter, EnvAdapter

Constant Summary collapse

VERSION =
"1.0.2".freeze

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.adapter_typeObject

Returns the value of attribute adapter_type.



8
9
10
# File 'lib/blinkist/config.rb', line 8

def adapter_type
  @adapter_type
end

.app_nameObject

Returns the value of attribute app_name.



8
9
10
# File 'lib/blinkist/config.rb', line 8

def app_name
  @app_name
end

.envObject

Returns the value of attribute env.



8
9
10
# File 'lib/blinkist/config.rb', line 8

def env
  @env
end

.loggerObject

Returns the value of attribute logger.



8
9
10
# File 'lib/blinkist/config.rb', line 8

def logger
  @logger
end

Class Method Details

.adapterObject



14
15
16
# File 'lib/blinkist/config.rb', line 14

def adapter
  @adapter ||= Adapter.instance_for adapter_type, env, app_name
end

.get(key, default = nil, scope: nil) ⇒ Object



10
11
12
# File 'lib/blinkist/config.rb', line 10

def get(key, default = nil, scope: nil)
  adapter.get(key, scope: scope) || default
end