Class: Requests::BearerAuth

Inherits:
Object
  • Object
show all
Includes:
AuthBase
Defined in:
lib/requests/auth.rb

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ BearerAuth

Returns a new instance of BearerAuth.



25
26
27
# File 'lib/requests/auth.rb', line 25

def initialize(token)
  @token = token
end

Instance Method Details

#call(hdrs) ⇒ Object



28
29
30
# File 'lib/requests/auth.rb', line 28

def call(hdrs)
  hdrs['Authorization'] = "Bearer #{@token}"
end