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
- .cache ⇒ Object
- .clear_caches ⇒ Object
- .clear_class_caches(object) ⇒ Object
- .clear_instance_caches(object) ⇒ Object
-
.included(base) ⇒ Object
The old method of including this module, if you don’t want to extend active record.
-
.init_rails ⇒ Object
Initializes AridCache for Rails.
- .store ⇒ Object
Methods included from Helpers
Class Method Details
.cache ⇒ Object
13 14 15 |
# File 'lib/arid_cache.rb', line 13 def self.cache AridCache::CacheProxy end |
.clear_caches ⇒ Object
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_rails ⇒ Object
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 |