Class: HTTP::AuthorizationHeader::BearerToken Deprecated

Inherits:
Object
  • Object
show all
Defined in:
lib/http/authorization_header/bearer_token.rb

Overview

Deprecated.

Will be remove in v0.7.0

OAuth2 Bearer token authorization header builder

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ BearerToken

Returns a new instance of BearerToken.

Parameters:

  • opts (#fetch)

Options Hash (opts):

  • :token (#to_s)
  • :encode (Boolean) — default: false

    deprecated



13
14
15
16
17
18
# File 'lib/http/authorization_header/bearer_token.rb', line 13

def initialize(opts)
  warn "#{Kernel.caller.first}: [DEPRECATION] BearerToken deprecated."

  @token = opts.fetch :token
  @token = Base64.strict_encode64 @token if opts.fetch(:encode, false)
end

Instance Method Details

#to_sObject

:nodoc:



21
22
23
# File 'lib/http/authorization_header/bearer_token.rb', line 21

def to_s
  "Bearer #{@token}"
end