Class: ApimaticCalculator::OAuth2
- Inherits:
-
CoreLibrary::HeaderAuth
- Object
- CoreLibrary::HeaderAuth
- ApimaticCalculator::OAuth2
- Defined in:
- lib/apimatic_calculator/http/auth/o_auth2.rb
Overview
Utility class for OAuth 2 authorization and token management.
Instance Method Summary collapse
-
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
-
#initialize(access_token) ⇒ OAuth2
constructor
Initialization constructor.
Constructor Details
#initialize(access_token) ⇒ OAuth2
Initialization constructor.
16 17 18 19 20 21 22 |
# File 'lib/apimatic_calculator/http/auth/o_auth2.rb', line 16 def initialize(access_token) auth_params = {} @_access_token = access_token auth_params['Authorization'] = "Bearer #{@_access_token}" unless @_access_token.nil? super auth_params end |
Instance Method Details
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
11 12 13 |
# File 'lib/apimatic_calculator/http/auth/o_auth2.rb', line 11 def 'BearerAuth: access_token is undefined.' end |