Class: Xberg::AuthConfigBearer

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
AuthConfig
Defined in:
lib/xberg/native.rb

Overview

Bearer token authentication.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tokenObject (readonly)

Returns the value of attribute token

Returns:

  • (Object)

    the current value of token



585
586
587
# File 'lib/xberg/native.rb', line 585

def token
  @token
end

Class Method Details

.from_hash(hash) ⇒ Object



601
602
603
# File 'lib/xberg/native.rb', line 601

def self.from_hash(hash)
  new(token: hash[:token] || hash["token"])
end

Instance Method Details

#basic?Boolean

Returns:

  • (Boolean)


593
# File 'lib/xberg/native.rb', line 593

def basic? = false

#bearer?Boolean

Returns:

  • (Boolean)


595
# File 'lib/xberg/native.rb', line 595

def bearer? = true

#header?Boolean

Returns:

  • (Boolean)


597
598
599
# File 'lib/xberg/native.rb', line 597

def header? = false
# @param hash [Hash] deserialized from the native extension
# @return [self]