Class: RSolr::Client::BasicAuth
- Inherits:
-
Struct
- Object
- Struct
- RSolr::Client::BasicAuth
- Defined in:
- lib/rsolr/client.rb
Overview
HTTP Basic Auth credentials, and how to render them as an Authorization header.
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password
14 15 16 |
# File 'lib/rsolr/client.rb', line 14 def password @password end |
#user ⇒ Object
Returns the value of attribute user
14 15 16 |
# File 'lib/rsolr/client.rb', line 14 def user @user end |
Instance Method Details
#header_value ⇒ Object
19 20 21 |
# File 'lib/rsolr/client.rb', line 19 def header_value "Basic #{Base64.strict_encode64("#{user}:#{password}")}" end |
#present? ⇒ Boolean
15 16 17 |
# File 'lib/rsolr/client.rb', line 15 def present? !!(user && password) end |