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 39 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 48 def clear @store = {} end
get(key)
click to toggle source
# File lib/mongo/auth/credential_cache.rb, line 29 def get(key) @store ||= {} @store[key] end
set(key, value)
click to toggle source
# File lib/mongo/auth/credential_cache.rb, line 34 def set(key, value) @store ||= {} @store[key] = value end