Module: Cachetastic::Cacheable::ClassOnlyMethods

Defined in:
lib/cachetastic/cacheable.rb

Instance Method Summary collapse

Instance Method Details

#delete_from_cache(key) ⇒ Object

Deletes an object from the cache for a given key.



191
192
193
# File 'lib/cachetastic/cacheable.rb', line 191

def delete_from_cache(key)
  cache_class.delete(key)
end

#get_from_cache(key, &block) ⇒ Object

Returns an object from the cache for a given key.



186
187
188
# File 'lib/cachetastic/cacheable.rb', line 186

def get_from_cache(key, &block)
  cache_class.get(key, &block)
end

#set_into_cache(key, value, expiry = 0) ⇒ Object

Sets an object into the cache for a given key.



196
197
198
# File 'lib/cachetastic/cacheable.rb', line 196

def set_into_cache(key, value, expiry = 0)
  cache_class.set(key, value, expiry)
end