Class: Requests::BearerAuth
- Inherits:
-
Object
- Object
- Requests::BearerAuth
- Includes:
- AuthBase
- Defined in:
- lib/requests/auth.rb
Instance Method Summary collapse
- #call(hdrs) ⇒ Object
-
#initialize(token) ⇒ BearerAuth
constructor
A new instance of BearerAuth.
Constructor Details
#initialize(token) ⇒ BearerAuth
Returns a new instance of BearerAuth.
25 26 27 |
# File 'lib/requests/auth.rb', line 25 def initialize(token) @token = token end |
Instance Method Details
#call(hdrs) ⇒ Object
28 29 30 |
# File 'lib/requests/auth.rb', line 28 def call(hdrs) hdrs['Authorization'] = "Bearer #{@token}" end |