Class: Xberg::AuthConfigBasic

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
AuthConfig
Defined in:
lib/xberg/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



4264
4265
4266
# File 'lib/xberg/native.rb', line 4264

def password
  @password
end

#usernameObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



4264
4265
4266
# File 'lib/xberg/native.rb', line 4264

def username
  @username
end

Class Method Details

.from_hash(hash) ⇒ Object



4283
4284
4285
# File 'lib/xberg/native.rb', line 4283

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

Instance Method Details

#basic?Boolean

Returns:

  • (Boolean)


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

def basic? = true

#bearer?Boolean

Returns:

  • (Boolean)


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

def bearer? = false

#header?Boolean

Returns:

  • (Boolean)


4279
4280
4281
# File 'lib/xberg/native.rb', line 4279

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