Class: AuthBasic
Instance Attribute Summary collapse
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #add_auth(http_client, req_kwargs) ⇒ Object
-
#initialize(username: nil, password: nil) ⇒ AuthBasic
constructor
A new instance of AuthBasic.
Constructor Details
#initialize(username: nil, password: nil) ⇒ AuthBasic
Returns a new instance of AuthBasic.
35 36 37 38 |
# File 'lib/one_doc.rb', line 35 def initialize(username: nil, password: nil) @username = username @password = password end |
Instance Attribute Details
#password ⇒ Object
Returns the value of attribute password.
33 34 35 |
# File 'lib/one_doc.rb', line 33 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
33 34 35 |
# File 'lib/one_doc.rb', line 33 def username @username end |
Instance Method Details
#add_auth(http_client, req_kwargs) ⇒ Object
40 41 42 43 44 45 46 |
# File 'lib/one_doc.rb', line 40 def add_auth(http_client, req_kwargs) if !@username.nil? && !@password.nil? http_client = http_client.basic_auth(user: @username, pass: @password) end return http_client, req_kwargs end |