Skip to content

Commit 7e884e2

Browse files
Document AS::Cache::Store#initialize options [ci-skip]
1 parent a95438c commit 7e884e2

File tree

1 file changed

+13
-3
lines changed
  • activesupport/lib/active_support

1 file changed

+13
-3
lines changed

activesupport/lib/active_support/cache.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,19 @@ def retrieve_pool_options(options)
214214
end
215215
end
216216

217-
# Creates a new cache. The options will be passed to any write method calls
218-
# except for <tt>:namespace</tt> which can be used to set the global
219-
# namespace for the cache.
217+
# Creates a new cache.
218+
#
219+
# ==== Options
220+
#
221+
# * +:namespace+ - Sets the namespace for the cache. This option is
222+
# especially useful if your application shares a cache with other
223+
# applications.
224+
# * +:coder+ - Replaces the default cache entry serialization mechanism
225+
# with a custom one. The +coder+ must respond to +dump+ and +load+.
226+
# Using a custom coder disables automatic compression.
227+
#
228+
# Any other specified options are treated as default options for the
229+
# relevant cache operations, such as #read, #write, and #fetch.
220230
def initialize(options = nil)
221231
@options = options ? normalize_options(options) : {}
222232
@options[:compress] = true unless @options.key?(:compress)

0 commit comments

Comments
 (0)