Module: SolidCache::Store::Api

Included in:
SolidCache::Store
Defined in:
lib/solid_cache/store/api.rb

Constant Summary collapse

DEFAULT_MAX_KEY_BYTESIZE =
1024
SQL_WILDCARD_CHARS =
[ "_", "%" ]

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#max_key_bytesizeObject (readonly)

Returns the value of attribute max_key_bytesize.



9
10
11
# File 'lib/solid_cache/store/api.rb', line 9

def max_key_bytesize
  @max_key_bytesize
end

Instance Method Details

#cleanup(options = nil) ⇒ Object

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/solid_cache/store/api.rb', line 25

def cleanup(options = nil)
  raise NotImplementedError.new("#{self.class.name} does not support cleanup")
end

#clear(options = nil) ⇒ Object



29
30
31
# File 'lib/solid_cache/store/api.rb', line 29

def clear(options = nil)
  entry_clear
end

#decrement(name, amount = 1, options = nil) ⇒ Object



21
22
23
# File 'lib/solid_cache/store/api.rb', line 21

def decrement(name, amount = 1, options = nil)
  adjust(name, -amount, options)
end

#increment(name, amount = 1, options = nil) ⇒ Object



17
18
19
# File 'lib/solid_cache/store/api.rb', line 17

def increment(name, amount = 1, options = nil)
  adjust(name, amount, options)
end

#initialize(options = {}) ⇒ Object



11
12
13
14
15
# File 'lib/solid_cache/store/api.rb', line 11

def initialize(options = {})
  super(options)

  @max_key_bytesize = options.fetch(:max_key_bytesize, DEFAULT_MAX_KEY_BYTESIZE)
end