Class: ApipieBindings::Authenticators::TokenAuth

Inherits:
Base
  • Object
show all
Defined in:
lib/apipie_bindings/authenticators/token_auth.rb

Instance Attribute Summary

Attributes inherited from Base

#auth_cookie

Instance Method Summary collapse

Methods inherited from Base

#error, #name, #response

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