Module: EasyMeli
- Defined in:
- lib/easy_meli.rb,
lib/easy_meli/errors.rb,
lib/easy_meli/version.rb,
lib/easy_meli/constants.rb
Defined Under Namespace
Classes: AccessTokenError, ApiClient, AuthenticationError, AuthorizationClient, BadGatewayError, Configuration, CreateTokenError, Error, ErrorParser, ForbiddenError, GatewayTimeoutError, InternalServerError, InvalidGrantError, InvalidTokenError, MalformedTokenError, NotImplementedError, ServerError, ServiceUnavailableError, TooManyRequestsError, UnknownError
Constant Summary
collapse
- VERSION =
'0.6.17'
- USER_AGENT =
"EasyMeli-%s" % VERSION
{
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'User-Agent' => USER_AGENT
}
Class Method Summary
collapse
Class Method Details
.access_token(refresh_token, logger: nil) ⇒ Object
.api_client(access_token: nil, refresh_token: nil, logger: nil) ⇒ Object
33
34
35
36
|
# File 'lib/easy_meli.rb', line 33
def self.api_client(access_token: nil, refresh_token: nil, logger: nil)
access_token ||= self.access_token(refresh_token, logger: logger) if refresh_token
EasyMeli::ApiClient.new(access_token, logger: logger)
end
|
.authorization_url(country_code, redirect_uri) ⇒ Object
.configuration ⇒ Object
13
14
15
|
# File 'lib/easy_meli.rb', line 13
def self.configuration
@configuration ||= Configuration.new
end
|
17
18
19
|
# File 'lib/easy_meli.rb', line 17
def self.configure
yield(configuration)
end
|
.create_token(code, redirect_uri, logger: nil) ⇒ Object