Class: HTTPX::Plugins::Authentication::Basic

Inherits:
Object
  • Object
show all
Defined in:
lib/httpx/plugins/auth/basic.rb

Instance Method Summary collapse

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

#authenticateObject



14
15
16
# File 'lib/httpx/plugins/auth/basic.rb', line 14

def authenticate(*)
  "Basic #{Base64.strict_encode64("#{@user}:#{@password}")}"
end