Class: Crawlberg::AuthConfigBasic

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

Overview

HTTP Basic authentication.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#passwordObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



60
61
62
# File 'lib/crawlberg/native.rb', line 60

def password
  @password
end

#usernameObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



60
61
62
# File 'lib/crawlberg/native.rb', line 60

def username
  @username
end

Class Method Details

.from_hash(hash) ⇒ Object



79
80
81
# File 'lib/crawlberg/native.rb', line 79

def self.from_hash(hash)
  new(username: hash[:username] || hash["username"], password: hash[:password] || hash["password"])
end

Instance Method Details

#basic?Boolean

Returns:

  • (Boolean)


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

def basic? = true

#bearer?Boolean

Returns:

  • (Boolean)


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

def bearer? = false

#header?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/crawlberg/native.rb', line 75

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