Module: ActiveSupport::Cache::MemoryStore::DupCoder
Do not use. This module is for internal use only.
Relationships & Source Files | |
Defined in: | activesupport/lib/active_support/cache/memory_store.rb |
Constant Summary
-
MARSHAL_SIGNATURE =
# File 'activesupport/lib/active_support/cache/memory_store.rb', line 54"\x04\x08".b.freeze
Instance Method Summary
Instance Method Details
#dump(entry)
[ GitHub ]#dump_compressed(entry, threshold)
[ GitHub ]# File 'activesupport/lib/active_support/cache/memory_store.rb', line 40
def dump_compressed(entry, threshold) compressed_entry = entry.compressed(threshold) compressed_entry.compressed? ? compressed_entry : dump(entry) end
#dump_value(value) (private)
[ GitHub ]# File 'activesupport/lib/active_support/cache/memory_store.rb', line 56
def dump_value(value) if value.is_a?(String) && !value.start_with?(MARSHAL_SIGNATURE) value.dup else Marshal.dump(value) end end
#load(entry)
[ GitHub ]#load_value(string) (private)
[ GitHub ]# File 'activesupport/lib/active_support/cache/memory_store.rb', line 64
def load_value(string) if string.start_with?(MARSHAL_SIGNATURE) Marshal.load(string) else string.dup end end