Class: Request::Auth::Basic

Inherits:
Object
  • Object
show all
Defined in:
lib/request/resources/auth.rb

Instance Method Summary collapse

Constructor Details

#initialize(headers, args) ⇒ Basic

Returns a new instance of Basic.



29
30
31
32
33
# File 'lib/request/resources/auth.rb', line 29

def initialize(headers, args)
  @headers = headers
  @user = args.user
  @pass = args.password
end

Instance Method Details

#applyObject



35
36
37
# File 'lib/request/resources/auth.rb', line 35

def apply
  @headers['Authorization'] = 'Basic ' + ["#{@user}:#{@pass}"].pack('m0')
end