Class: Lmb::Developers::Configuration
- Inherits:
-
Object
- Object
- Lmb::Developers::Configuration
- Defined in:
- lib/lmb/developers/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#configure(environment = 'DEV', api_key) ⇒ Lmb::Developers::Configuration
Configure global parameters.
-
#initialize ⇒ Configuration
constructor
Initial config.
Constructor Details
#initialize ⇒ Configuration
Initial config.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/lmb/developers/configuration.rb', line 9 def initialize @config = { 'DEV' => { 'url': 'https://api-dev.leroymerlin.com.br' }, 'TEST' => { 'url': 'https://api-test.leroymerlin.com.br' }, 'PROD' => { 'url': 'https://api.leroymerlin.com.br' } } configure('DEV', nil) end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
4 5 6 |
# File 'lib/lmb/developers/configuration.rb', line 4 def api_key @api_key end |
#environment ⇒ Object
Returns the value of attribute environment.
4 5 6 |
# File 'lib/lmb/developers/configuration.rb', line 4 def environment @environment end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/lmb/developers/configuration.rb', line 6 def url @url end |
Instance Method Details
#configure(environment = 'DEV', api_key) ⇒ Lmb::Developers::Configuration
Configure global parameters
28 29 30 31 32 33 |
# File 'lib/lmb/developers/configuration.rb', line 28 def configure(environment = 'DEV', api_key) @api_key = api_key @environment = environment @url = @config[environment][:url] self end |