Class: HTTPX::Plugins::Authentication::Basic
- Inherits:
-
Object
- Object
- HTTPX::Plugins::Authentication::Basic
- Defined in:
- lib/httpx/plugins/auth/basic.rb
Instance Method Summary collapse
- #authenticate ⇒ Object
-
#initialize(user, password) ⇒ Basic
constructor
A new instance of Basic.
Constructor Details
#initialize(user, password) ⇒ Basic
Returns a new instance of Basic.
9 10 11 12 |
# File 'lib/httpx/plugins/auth/basic.rb', line 9 def initialize(user, password, **) @user = user @password = password end |
Instance Method Details
#authenticate ⇒ Object
14 15 16 |
# File 'lib/httpx/plugins/auth/basic.rb', line 14 def authenticate(*) "Basic #{Base64.strict_encode64("#{@user}:#{@password}")}" end |