Class: RSolr::Client::BasicAuth

Inherits:
Struct
  • Object
show all
Defined in:
lib/rsolr/client.rb

Overview

HTTP Basic Auth credentials, and how to render them as an Authorization header.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#passwordObject

Returns the value of attribute password

Returns:

  • the current value of password



14
15
16
# File 'lib/rsolr/client.rb', line 14

def password
  @password
end

#userObject

Returns the value of attribute user

Returns:

  • the current value of user



14
15
16
# File 'lib/rsolr/client.rb', line 14

def user
  @user
end

Instance Method Details

#header_valueObject



19
20
21
# File 'lib/rsolr/client.rb', line 19

def header_value
  "Basic #{Base64.strict_encode64("#{user}:#{password}")}"
end

#present?Boolean

Returns:



15
16
17
# File 'lib/rsolr/client.rb', line 15

def present?
  !!(user && password)
end