Class: Faraday::Request::TokenAuthentication

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

Overview

TokenAuthentication is a middleware that adds a 'Token' header to a Faraday request.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of TokenAuthentication.


15
16
17
# File 'lib/faraday/request/token_authentication.rb', line 15

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

Class Method Details

.header(token, options = nil) ⇒ Object

Public


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

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