new(value, compress: true, compress_threshold: DEFAULT_COMPRESS_LIMIT, version: nil, expires_in: nil, **)
public
Creates a new
cache entry for the specified value. Options supported
are :compress, :compress_threshold, :version and
:expires_in.
# File activesupport/lib/active_support/cache.rb, line 780
def initialize(value, compress: true, compress_threshold: DEFAULT_COMPRESS_LIMIT, version: nil, expires_in: nil, **)
@value = value
@version = version
@created_at = Time.now.to_f
@expires_in = expires_in && expires_in.to_f
compress!(compress_threshold) if compress
end