Class: RHC::Rest::WWWAuth::DeferredCredential
- Defined in:
- lib/rhc/rest/httpclient.rb
Instance Method Summary collapse
-
#initialize(user, password) ⇒ DeferredCredential
constructor
A new instance of DeferredCredential.
- #passwd ⇒ Object
-
#to_str ⇒ Object
Pretend to be a string.
- #user ⇒ Object
Constructor Details
#initialize(user, password) ⇒ DeferredCredential
Returns a new instance of DeferredCredential.
102 103 104 |
# File 'lib/rhc/rest/httpclient.rb', line 102 def initialize(user, password) @user, @password = user, password end |
Instance Method Details
#passwd ⇒ Object
108 109 110 |
# File 'lib/rhc/rest/httpclient.rb', line 108 def passwd (@password.call if @password.respond_to?(:call)) or @password end |
#to_str ⇒ Object
Pretend to be a string
115 116 117 |
# File 'lib/rhc/rest/httpclient.rb', line 115 def to_str ["#{user}:#{passwd}"].pack('m').tr("\n", '') end |
#user ⇒ Object
105 106 107 |
# File 'lib/rhc/rest/httpclient.rb', line 105 def user (@user.call if @user.respond_to?(:call)) or @user end |