Class: ActiveSupport::Cache::CompressedMemCacheStore
- Inherits:
-
MemCacheStore
- Object
- Store
- MemCacheStore
- ActiveSupport::Cache::CompressedMemCacheStore
- Defined in:
- lib/gems/activesupport-2.2.2/lib/active_support/cache/compressed_mem_cache_store.rb
Instance Attribute Summary
Attributes inherited from MemCacheStore
Instance Method Summary collapse
Methods inherited from MemCacheStore
#clear, #decrement, #delete, #delete_matched, #exist?, #increment, #initialize, #stats
Methods inherited from Store
#decrement, #delete, #delete_matched, #exist?, #fetch, #increment, #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/gems/activesupport-2.2.2/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/gems/activesupport-2.2.2/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 |