Class: Manceps::Auth::Bearer
- Inherits:
-
Object
- Object
- Manceps::Auth::Bearer
- Defined in:
- lib/manceps/auth/bearer.rb
Overview
Authenticates requests with a Bearer token.
Instance Method Summary collapse
- #apply(headers) ⇒ Object
-
#initialize(token) ⇒ Bearer
constructor
A new instance of Bearer.
Constructor Details
#initialize(token) ⇒ Bearer
Returns a new instance of Bearer.
7 8 9 |
# File 'lib/manceps/auth/bearer.rb', line 7 def initialize(token) @token = token end |
Instance Method Details
#apply(headers) ⇒ Object
11 12 13 |
# File 'lib/manceps/auth/bearer.rb', line 11 def apply(headers) headers['authorization'] = "Bearer #{@token}" end |