Class: ActiveSupport::Cache::MemcachedSnappyStore

Inherits:
MemcachedStore
  • Object
show all
Defined in:
lib/active_support/cache/memcached_snappy_store.rb

Defined Under Namespace

Modules: SnappyCompressor Classes: UnsupportedOperation

Constant Summary

Constants inherited from MemcachedStore

ActiveSupport::Cache::MemcachedStore::ESCAPE_KEY_CHARS

Instance Attribute Summary

Attributes inherited from MemcachedStore

#swallow_exceptions

Instance Method Summary collapse

Methods inherited from MemcachedStore

#append, #cas, #cas_multi, #clear, #delete, #exist?, #read_multi, #reset, #stats, #write

Constructor Details

#initialize(*addresses, **options) ⇒ MemcachedSnappyStore

Returns a new instance of MemcachedSnappyStore.



38
39
40
41
42
# File 'lib/active_support/cache/memcached_snappy_store.rb', line 38

def initialize(*addresses, **options)
  options[:codec] ||= ActiveSupport::Cache::MemcachedStore::Codec.new(compressor: SnappyCompressor)
  options[:compress] = false
  super(*addresses, **options)
end

Instance Method Details

#decrementObject



29
30
31
# File 'lib/active_support/cache/memcached_snappy_store.rb', line 29

def decrement(*)
  raise UnsupportedOperation, "decrement is not supported by: #{self.class.name}"
end

#incrementObject



25
26
27
# File 'lib/active_support/cache/memcached_snappy_store.rb', line 25

def increment(*)
  raise UnsupportedOperation, "increment is not supported by: #{self.class.name}"
end

#read_onlyObject

IdentityCache has its own handling for read only.



34
35
36
# File 'lib/active_support/cache/memcached_snappy_store.rb', line 34

def read_only
  false
end