Class: ActiveSupport::Cache::CompressedLibmemcachedStore
- Inherits:
-
LibmemcachedStore
- Object
- Store
- LibmemcachedStore
- ActiveSupport::Cache::CompressedLibmemcachedStore
- Defined in:
- lib/active_support/cache/compressed_libmemcached_store.rb
Constant Summary
Constants inherited from LibmemcachedStore
LibmemcachedStore::DEFAULT_OPTIONS
Instance Attribute Summary
Attributes inherited from LibmemcachedStore
Instance Method Summary collapse
Methods inherited from LibmemcachedStore
#clear, #decrement, #increment, #initialize, #stats
Constructor Details
This class inherits a constructor from ActiveSupport::Cache::LibmemcachedStore
Instance Method Details
#read(name, options = {}) ⇒ Object
4 5 6 7 8 |
# File 'lib/active_support/cache/compressed_libmemcached_store.rb', line 4 def read(name, = {}) if value = super(name, ( || {}).merge(:raw => true)) Marshal.load(ActiveSupport::Gzip.decompress(value)) end end |
#write(name, value, options = {}) ⇒ Object
10 11 12 |
# File 'lib/active_support/cache/compressed_libmemcached_store.rb', line 10 def write(name, value, = {}) super(name, ActiveSupport::Gzip.compress(Marshal.dump(value)), ( || {}).merge(:raw => true)) end |