method
write_multi
rails latest stable - Class:
ActiveSupport::Cache::Store
write_multi(hash, options = nil)public
Cache Storage API to write multiple values at once.
# File activesupport/lib/active_support/cache.rb, line 558
def write_multi(hash, options = nil)
return hash if hash.empty?
options = merged_options(options)
instrument_multi :write_multi, hash, options do |payload|
entries = hash.each_with_object({}) do |(name, value), memo|
memo[normalize_key(name, options)] = Entry.new(value, **options.merge(version: normalize_version(name, options)))
end
write_multi_entries entries, **options
end
end Related methods
- Instance methods
- cleanup
- clear
- decrement
- delete
- delete_matched
- delete_multi
- exist?
- fetch
- fetch_multi
- increment
- mute
- new_entry
- read
- read_multi
- silence!
- write
- write_multi
- Class methods
- new
- Private methods
-
retrieve_pool_options -
_instrument -
default_serializer -
delete_entry -
delete_multi_entries -
deserialize_entry -
expanded_key -
expanded_version -
get_entry_value -
handle_expired_entry -
handle_invalid_expires_in -
instrument -
instrument_multi -
key_matcher -
merged_options -
namespace_key -
normalize_key -
normalize_options -
normalize_version -
read_entry -
read_multi_entries -
save_block_result_to_cache -
serialize_entry -
validate_options -
write_entry -
write_multi_entries