Module: AridCache

Extended by:
Helpers
Defined in:
lib/arid_cache.rb,
lib/arid_cache/store.rb,
lib/arid_cache/helpers.rb,
lib/arid_cache/cache_proxy.rb,
lib/arid_cache/active_record.rb

Defined Under Namespace

Modules: ActiveRecord, Helpers Classes: CacheProxy, Error, Store

Class Method Summary collapse

Methods included from Helpers

define, lookup

Class Method Details

.cacheObject



13
14
15
# File 'lib/arid_cache.rb', line 13

def self.cache
  AridCache::CacheProxy
end

.clear_cachesObject



17
18
19
# File 'lib/arid_cache.rb', line 17

def self.clear_caches
  AridCache::CacheProxy.clear_caches
end

.clear_class_caches(object) ⇒ Object



21
22
23
# File 'lib/arid_cache.rb', line 21

def self.clear_class_caches(object)
  AridCache::CacheProxy.clear_class_caches(object)
end

.clear_instance_caches(object) ⇒ Object



25
26
27
# File 'lib/arid_cache.rb', line 25

def self.clear_instance_caches(object)
  AridCache::CacheProxy.clear_instance_caches(object)
end

.included(base) ⇒ Object

The old method of including this module, if you don’t want to extend active record. Just add ‘include AridCache’ to your model class.



36
37
38
# File 'lib/arid_cache.rb', line 36

def self.included(base)
  base.send(:include, AridCache::ActiveRecord)
end

.init_railsObject

Initializes AridCache for Rails.

This method is called by ‘init.rb`, which is run by Rails on startup.



44
45
46
# File 'lib/arid_cache.rb', line 44

def self.init_rails
  ::ActiveRecord::Base.send(:include, AridCache::ActiveRecord)
end

.storeObject



29
30
31
# File 'lib/arid_cache.rb', line 29

def self.store
  AridCache::Store.instance
end