Class: Asana::Authentication::TokenAuthentication
- Inherits:
-
Object
- Object
- Asana::Authentication::TokenAuthentication
- Defined in:
- lib/asana/authentication/token_authentication.rb
Overview
Represents an API token authentication mechanism.
Instance Method Summary collapse
-
#configure(connection) ⇒ void
Configures a Faraday connection injecting its token as basic auth.
-
#initialize(token) ⇒ TokenAuthentication
constructor
A new instance of TokenAuthentication.
Constructor Details
#initialize(token) ⇒ TokenAuthentication
Returns a new instance of TokenAuthentication.
7 8 9 |
# File 'lib/asana/authentication/token_authentication.rb', line 7 def initialize(token) @token = token end |
Instance Method Details
#configure(connection) ⇒ void
This method returns an undefined value.
Configures a Faraday connection injecting its token as basic auth.
17 18 19 |
# File 'lib/asana/authentication/token_authentication.rb', line 17 def configure(connection) connection.request :authorization, :basic, @token, '' end |