Enables the dynamic configuration of Cache entry options while ensuring that conflicting options are not both set. When a block is given to ActiveSupport::Cache::Store#fetch, the second argument will be an instance of WriteOptions.

Methods

Instance Public methods

expires_at()

πŸ“ Source code
# File activesupport/lib/active_support/cache.rb, line 1089
      def expires_at
        @options[:expires_at]
      end
πŸ”Ž See on GitHub

expires_at=(expires_at)

Sets the Cache entry’s expires_at value. If an expires_in option was previously set, this will unset it since expires_at and expires_in cannot both be set.

πŸ“ Source code
# File activesupport/lib/active_support/cache.rb, line 1096
      def expires_at=(expires_at)
        @options.delete(:expires_in)
        @options[:expires_at] = expires_at
      end
πŸ”Ž See on GitHub

expires_in()

πŸ“ Source code
# File activesupport/lib/active_support/cache.rb, line 1077
      def expires_in
        @options[:expires_in]
      end
πŸ”Ž See on GitHub

expires_in=(expires_in)

Sets the Cache entry’s expires_in value. If an expires_at option was previously set, this will unset it since expires_in and expires_at cannot both be set.

πŸ“ Source code
# File activesupport/lib/active_support/cache.rb, line 1084
      def expires_in=(expires_in)
        @options.delete(:expires_at)
        @options[:expires_in] = expires_in
      end
πŸ”Ž See on GitHub

version()

πŸ“ Source code
# File activesupport/lib/active_support/cache.rb, line 1069
      def version
        @options[:version]
      end
πŸ”Ž See on GitHub

version=(version)

πŸ“ Source code
# File activesupport/lib/active_support/cache.rb, line 1073
      def version=(version)
        @options[:version] = version
      end
πŸ”Ž See on GitHub