啟用 Cache
條目選項的動態組態,同時確保不會同時設定衝突的選項。當區塊傳遞給 ActiveSupport::Cache::Store#fetch
時,第二個引數會是 WriteOptions
的執行個體。
方法
執行個體公開方法
expires_at() 連結
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache.rb, line 1096 def expires_at @options[:expires_at] end
expires_at=(expires_at) 連結
設定 Cache
條目的 expires_at
值。如果先前已設定 expires_in
選項,這會取消設定,因為 expires_at
和 expires_in
兩者不能同時設定。
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache.rb, line 1103 def expires_at=(expires_at) @options.delete(:expires_in) @options[:expires_at] = expires_at end
expires_in() 連結
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache.rb, line 1084 def expires_in @options[:expires_in] end
expires_in=(expires_in) 連結
設定 Cache
條目的 expires_in
值。如果先前已設定 expires_at
選項,這會取消設定,因為 expires_in
和 expires_at
兩者不能同時設定。
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache.rb, line 1091 def expires_in=(expires_in) @options.delete(:expires_at) @options[:expires_in] = expires_in end
version() 連結
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache.rb, line 1076 def version @options[:version] end
version=(version) 連結
來源:顯示 | 在 GitHub 上
# File activesupport/lib/active_support/cache.rb, line 1080 def version=(version) @options[:version] = version end