class RoadForest::HTTP::PreparedCredentialSource

Public Class Methods

new() click to toggle source
# File lib/roadforest/http/keychain.rb, line 28
def initialize
  @for_url = Hash.new{|h,k| h[k] = []}
end

Public Instance Methods

add(url, user, secret) click to toggle source
# File lib/roadforest/http/keychain.rb, line 32
def add(url, user, secret)
  creds = BasicCredentials.new(user, secret)
  add_credentials(url, creds)
end
add_credentials(url, creds) click to toggle source
# File lib/roadforest/http/keychain.rb, line 37
def add_credentials(url, creds)
  @for_url[canonical_root(url)] << creds
end
respond_to_challenge(url, realm, attempt) click to toggle source
# File lib/roadforest/http/keychain.rb, line 41
def respond_to_challenge(url, realm, attempt)
  @for_url[canonical_root(url)].fetch(attempt)
rescue IndexError
  nil
end