class CacheStoreContract

Defines the contract that CacheStore implementations must adhere to.

Public Class Methods

new(namespace = '') click to toggle source
# File lib/cache_store.rb, line 9
def initialize(namespace = '')
end

Public Instance Methods

exist?(key) click to toggle source

Checks if a value exists within this cache store for a specific key.

@param [String] This is the unique key to reference the value to check for within this cache store.

# File lib/cache_store.rb, line 37
def exist?(key)
end
get(key, expires_in = 0, &block) click to toggle source

Gets a value from this cache store by its unique key.

@param [String] This is the unique key to reference the value to fetch from within this cache store. @param [Integer] This is the number of seconds from the current time that this value should expire. (This is used in conjunction with the block to hydrate the cache key if it is empty.) @param [Block] This block is provided to hydrate this cache store with the value for the request key when it is not found.

# File lib/cache_store.rb, line 25
def get(key, expires_in = 0, &block)
end
remove(key) click to toggle source

Removes a value from this cache store by its unique key.

@param [String] This is the unique key to reference the value to remove from this cache store.

# File lib/cache_store.rb, line 31
def remove(key)
end
set(key, value, expires_in = 0) click to toggle source

Sets a value within this cache store by its key.

@param [String] This is the unique key to reference the value being set within this cache store. @param [Object] This is the value to set within this cache store. @param [Integer] This is the number of seconds from the current time that this value should expire.

# File lib/cache_store.rb, line 17
def set(key, value, expires_in = 0)
end