Class: Faraday::Request::TokenAuthentication

Inherits:
Authorization show all
Defined in:
lib/faraday/request/token_authentication.rb

Constant Summary

Constants inherited from Authorization

Authorization::KEY

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Authorization

build_hash, #call

Methods inherited from Middleware

adapter?, dependency, inherited, loaded?, new

Methods included from MiddlewareRegistry

#lookup_middleware, #register_middleware

Constructor Details

#initialize(app, token, options = nil) ⇒ TokenAuthentication

Returns a new instance of TokenAuthentication.



10
11
12
# File 'lib/faraday/request/token_authentication.rb', line 10

def initialize(app, token, options = nil)
  super(app, token, options)
end

Class Method Details

.header(token, options = nil) ⇒ Object

Public



4
5
6
7
8
# File 'lib/faraday/request/token_authentication.rb', line 4

def self.header(token, options = nil)
  options ||= {}
  options[:token] = token
  super :Token, options
end