Module: Itrigga::Cache
- Defined in:
- lib/itrigga/cache/cache.rb,
lib/itrigga/cache/dalli.rb,
lib/itrigga/cache/memcache.rb,
lib/itrigga/cache/filecache.rb
Defined Under Namespace
Modules: ClassMethods, ControllerMethods, InstanceMethods
Classes: Dalli, Filecache, Memcache
Class Method Summary
collapse
Class Method Details
.included(base) ⇒ Object
9
10
11
12
13
14
|
# File 'lib/itrigga/cache/cache.rb', line 9
def self.included(base)
base.extend(ClassMethods)
base.send(:include, InstanceMethods)
base.send(:include, Trigga::ParamFu)
base.send(:include, ControllerMethods) if defined?(ActionController::Base) && base.ancestors.include?(ActionController::Base)
end
|
.instance(opts = {}) ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/itrigga/cache/cache.rb', line 28
def self.instance(opts = {})
case ( opts[:backend] ||= @default_cache_type )
when :memcached
Itrigga::Cache::Memcache.instance
when :dalli
Itrigga::Cache::Dalli.instance
when :filecache
Itrigga::Cache::Filecache.instance
else
nil
end
end
|
.setup!(opts = {}) ⇒ Object