Class: FdxV660Api::TaxBasicAuth
- Inherits:
-
CoreLibrary::HeaderAuth
- Object
- CoreLibrary::HeaderAuth
- FdxV660Api::TaxBasicAuth
- Includes:
- CoreLibrary
- Defined in:
- lib/fdx_v660_api/http/auth/tax_basic_auth.rb
Overview
Utility class for basic authorization.
Instance Method Summary collapse
-
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
-
#initialize(tax_basic_auth_credentials) ⇒ TaxBasicAuth
constructor
Initialization constructor.
Constructor Details
#initialize(tax_basic_auth_credentials) ⇒ TaxBasicAuth
Initialization constructor.
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/fdx_v660_api/http/auth/tax_basic_auth.rb', line 17 def initialize(tax_basic_auth_credentials) auth_params = {} unless tax_basic_auth_credentials.nil? || tax_basic_auth_credentials.username.nil? || tax_basic_auth_credentials.password.nil? auth_params['Authorization'] = "Basic #{AuthHelper.get_base64_encoded_value(tax_basic_auth_credentials.username, tax_basic_auth_credentials.password)}" end super auth_params end |
Instance Method Details
#error_message ⇒ Object
Display error message on occurrence of authentication failure.
12 13 14 |
# File 'lib/fdx_v660_api/http/auth/tax_basic_auth.rb', line 12 def 'TaxBasicAuth: username or password is undefined.' end |