本機快取儲存
簡單的記憶體備份快取。此快取並非執行緒安全,且僅用於作為單一執行緒的暫時記憶體快取。
方法
- C
- D
- N
- R
- W
類別公開方法
new() 連結
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 36 def initialize @data = {} end
執行個體公開方法
clear(options = nil) 連結
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 40 def clear(options = nil) @data.clear end
delete_entry(key) 連結
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 57 def delete_entry(key) !!@data.delete(key) end
read_entry(key) 連結
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 44 def read_entry(key) @data[key] end
read_multi_entries(keys) 連結
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 48 def read_multi_entries(keys) @data.slice(*keys) end
write_entry(key, entry) 連結
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 52 def write_entry(key, entry) @data[key] = entry true end