класс ActiveSupport::Cache::WriteOptions
Позволяет динамически настраивать параметры записи в Cache , гарантируя, что конфликтующие параметры не будут установлены одновременно. Если в ActiveSupport::Cache::Store#fetch передаётся блок, то второй аргумент будет экземпляром WriteOptions.
Открытые методы экземпляра
# File activesupport/lib/active_support/cache.rb, line 1094 def expires_at @options[:expires_at] end
# File activesupport/lib/active_support/cache.rb, line 1101 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 1082 def expires_in @options[:expires_in] end
# File activesupport/lib/active_support/cache.rb, line 1089 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 1074 def version @options[:version] end
# File activesupport/lib/active_support/cache.rb, line 1078 def version=(version) @options[:version] = version end
© 2004–2021 David Heinemeier Hansson
Licensed under the MIT License.