class Lmb::Developers::Configuration

Attributes

api_key[RW]
environment[RW]
url[R]

Public Class Methods

new() click to toggle source

Initial config.

# 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

Public Instance Methods

configure(environment = 'DEV', api_key) click to toggle source

Configure global parameters

@param environment [String] environment to consume APIs, `TEST` or `PROD` @param api_key [String] ApiKey to consume APIs. @return [Lmb::Developers::Configuration]

# 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