Class: ActiveSupport::Cache::CompressedMemCacheStore
- Inherits:
-
MemCacheStore
- Object
- Store
- MemCacheStore
- ActiveSupport::Cache::CompressedMemCacheStore
- Defined in:
- lib/active_support/cache/compressed_mem_cache_store.rb
Instance Attribute Summary
Attributes inherited from Store
Instance Method Summary collapse
Methods inherited from MemCacheStore
build_mem_cache, #clear, #decrement, #delete, #delete_matched, #exist?, #increment, #initialize, #read_multi, #stats
Methods inherited from Store
#decrement, #delete, #delete_matched, #exist?, #fetch, #increment, #mute, #silence!
Constructor Details
This class inherits a constructor from ActiveSupport::Cache::MemCacheStore
Instance Method Details
#read(name, options = nil) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/active_support/cache/compressed_mem_cache_store.rb', line 4 def read(name, = nil) if value = super(name, ( || {}).merge(:raw => true)) if raw?() value else Marshal.load(ActiveSupport::Gzip.decompress(value)) end end end |
#write(name, value, options = nil) ⇒ Object
14 15 16 17 |
# File 'lib/active_support/cache/compressed_mem_cache_store.rb', line 14 def write(name, value, = nil) value = ActiveSupport::Gzip.compress(Marshal.dump(value)) unless raw?() super(name, value, ( || {}).merge(:raw => true)) end |