Class: Manceps::Auth::Bearer

Inherits:
Object
  • Object
show all
Defined in:
lib/manceps/auth/bearer.rb

Overview

Authenticates requests with a Bearer token.

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Bearer

Returns a new instance of Bearer.



7
8
9
# File 'lib/manceps/auth/bearer.rb', line 7

def initialize(token)
  @token = token
end

Instance Method Details

#apply(headers) ⇒ Object



11
12
13
# File 'lib/manceps/auth/bearer.rb', line 11

def apply(headers)
  headers['authorization'] = "Bearer #{@token}"
end