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.



193
194
195
# File 'lib/cachetastic/cacheable.rb', line 193

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.



188
189
190
# File 'lib/cachetastic/cacheable.rb', line 188

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.



198
199
200
# File 'lib/cachetastic/cacheable.rb', line 198

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