Class: RestClientWrapper::Authenticator::Basic
- Inherits:
-
Object
- Object
- RestClientWrapper::Authenticator::Basic
- Includes:
- RestClientWrapper::Auth
- Defined in:
- lib/rest_client_wrapper/authenticators/basic.rb
Overview
Basic
Instance Method Summary collapse
- #generate_auth ⇒ Object
-
#initialize(**config) ⇒ Basic
constructor
A new instance of Basic.
Constructor Details
#initialize(**config) ⇒ Basic
Returns a new instance of Basic.
32 33 34 35 |
# File 'lib/rest_client_wrapper/authenticators/basic.rb', line 32 def initialize(**config) @username = config[:username] @password = config[:password] end |
Instance Method Details
#generate_auth ⇒ Object
37 38 39 |
# File 'lib/rest_client_wrapper/authenticators/basic.rb', line 37 def generate_auth return { Authorization: "Basic #{ Base64.strict_encode64("#{ @username }:#{ @password }") }" } end |