Class: Request::Auth::Basic
- Inherits:
-
Object
- Object
- Request::Auth::Basic
- Defined in:
- lib/request/resources/auth.rb
Instance Method Summary collapse
- #apply ⇒ Object
-
#initialize(headers, args) ⇒ Basic
constructor
A new instance of Basic.
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
#apply ⇒ Object
35 36 37 |
# File 'lib/request/resources/auth.rb', line 35 def apply @headers['Authorization'] = 'Basic ' + ["#{@user}:#{@pass}"].pack('m0') end |