Class: Crawlberg::AuthConfigBearer

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

Overview

Bearer token authentication.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#tokenObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



91
92
93
# File 'lib/crawlberg/native.rb', line 91

def token
  @token
end

Class Method Details

.from_hash(hash) ⇒ Object



108
109
110
# File 'lib/crawlberg/native.rb', line 108

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

Instance Method Details

#basic?Boolean

Returns:

  • (Boolean)


100
# File 'lib/crawlberg/native.rb', line 100

def basic? = false

#bearer?Boolean

Returns:

  • (Boolean)


102
# File 'lib/crawlberg/native.rb', line 102

def bearer? = true

#header?Boolean

Returns:

  • (Boolean)


104
105
106
# File 'lib/crawlberg/native.rb', line 104

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