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.
-
#password ⇒ Object
Returns the value of attribute password.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#configure(environment = 'DEV', api_key = 'api_key', username = 'username', password = 'password') ⇒ Lmb::Developers::Configuration
Configure global parameters.
-
#initialize ⇒ Configuration
constructor
Initial config.
Constructor Details
#initialize ⇒ Configuration
Initial config.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/lmb/developers/configuration.rb', line 11 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 |
#password ⇒ Object
Returns the value of attribute password.
4 5 6 |
# File 'lib/lmb/developers/configuration.rb', line 4 def password @password end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'lib/lmb/developers/configuration.rb', line 8 def url @url end |
#username ⇒ Object
Returns the value of attribute username.
4 5 6 |
# File 'lib/lmb/developers/configuration.rb', line 4 def username @username end |
Instance Method Details
#configure(environment = 'DEV', api_key = 'api_key', username = 'username', password = 'password') ⇒ Lmb::Developers::Configuration
Configure global parameters
32 33 34 35 36 37 38 39 |
# File 'lib/lmb/developers/configuration.rb', line 32 def configure(environment = 'DEV', api_key = 'api_key', username = 'username', password = 'password') @api_key = api_key @username = username @password = password @environment = environment @url = @config[environment][:url] self end |