Class: ApipieBindings::Authenticators::TokenAuth
- Defined in:
- lib/apipie_bindings/authenticators/token_auth.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #authenticate(req, token) ⇒ Object
-
#initialize(token) ⇒ TokenAuth
constructor
A new instance of TokenAuth.
Methods inherited from Base
Constructor Details
#initialize(token) ⇒ TokenAuth
Returns a new instance of TokenAuth.
6 7 8 |
# File 'lib/apipie_bindings/authenticators/token_auth.rb', line 6 def initialize(token) @token = token end |
Instance Method Details
#authenticate(req, token) ⇒ Object
10 11 12 |
# File 'lib/apipie_bindings/authenticators/token_auth.rb', line 10 def authenticate(req, token) req['Authorization'] = "Bearer #{@token}" end |