instance method
write
Ruby on Rails 6.1.7.10
Since v2.2.3Signature
write(name, value, options = nil)
Writes the value to the cache, with the key.
Options are passed to the underlying cache implementation.
Parameters
-
namereq -
valuereq -
optionsopt = nil
Source
# File activesupport/lib/active_support/cache.rb, line 471
def write(name, value, options = nil)
options = merged_options(options)
instrument(:write, name, options) do
entry = Entry.new(value, **options.merge(version: normalize_version(name, options)))
write_entry(normalize_key(name, options), entry, **options)
end
end
Defined in activesupport/lib/active_support/cache.rb line 471
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache::Store