module Mongo::Auth::CredentialCache

Cache store for computed SCRAM credentials.

@api private

Attributes

store[R]

Public Instance Methods

cache(key) { || ... } click to toggle source
# File lib/mongo/auth/credential_cache.rb, line 40
                def cache(key)
  value = get(key)
  if value.nil?
    value = yield
    set(key, value)
  end
  value
end
clear() click to toggle source
# File lib/mongo/auth/credential_cache.rb, line 49
                def clear
  @store = {}
end
get(key) click to toggle source
# File lib/mongo/auth/credential_cache.rb, line 30
                def get(key)
  @store ||= {}
  @store[key]
end
set(key, value) click to toggle source
# File lib/mongo/auth/credential_cache.rb, line 35
                def set(key, value)
  @store ||= {}
  @store[key] = value
end