класс ActiveSupport::Cache::WriteOptions
Включает динамическую настройку параметров записи в Cache при условии, что не задаются взаимоисключающие параметры. Если в метод ActiveSupport::Cache::Store#fetch передаётся блок, то вторым аргументом будет экземпляр WriteOptions.
Открытые методы экземпляра
# File activesupport/lib/active_support/cache.rb, line 1089 def expires_at @options[:expires_at] end
# File activesupport/lib/active_support/cache.rb, line 1096 def expires_at=(expires_at) @options.delete(:expires_in) @options[:expires_at] = expires_at end
Устанавливает значение параметра expires_at для записи в Cache. Если ранее был установлен параметр expires_in, он будет сброшен, так как expires_at и expires_in не могут быть установлены одновременно.
# File activesupport/lib/active_support/cache.rb, line 1077 def expires_in @options[:expires_in] end
# File activesupport/lib/active_support/cache.rb, line 1084 def expires_in=(expires_in) @options.delete(:expires_at) @options[:expires_in] = expires_in end
Устанавливает значение параметра expires_in для записи в Cache. Если ранее был установлен параметр expires_at, он будет сброшен, так как expires_in и expires_at не могут быть установлены одновременно.
# File activesupport/lib/active_support/cache.rb, line 1069 def version @options[:version] end
# File activesupport/lib/active_support/cache.rb, line 1073 def version=(version) @options[:version] = version end
© 2004–2021 David Heinemeier Hansson
Licensed under the MIT License.