Module: AppCache
- Defined in:
- lib/app_cache.rb,
lib/app_cache/engine.rb,
lib/app_cache/railtie.rb,
lib/app_cache/version.rb,
lib/app_cache/local_file_cache.rb,
app/models/app_cache/system_param.rb
Defined Under Namespace
Classes: Engine, LocalFileCache, MigrationGenerator, Railtie, SystemParam
Constant Summary collapse
- CACHE_TYPE_REDIS =
'redis'
- CACHE_TYPE_FILE =
'file'
- VERSION =
"0.1.1"
Class Attribute Summary collapse
-
.storage ⇒ Object
Returns the value of attribute storage.
Class Method Summary collapse
- .get_param_value(key) ⇒ Object
- .get_params ⇒ Object
- .new(cache_type, options = {}) ⇒ Object
- .sys_params_cache ⇒ Object
- .sys_params_db ⇒ Object
Class Attribute Details
.storage ⇒ Object
Returns the value of attribute storage.
11 12 13 |
# File 'lib/app_cache.rb', line 11 def storage @storage end |
Class Method Details
.get_param_value(key) ⇒ Object
39 40 41 42 |
# File 'lib/app_cache.rb', line 39 def get_param_value(key) val = AppCache::SystemParam.get_param_value(key) val end |
.get_params ⇒ Object
34 35 36 37 |
# File 'lib/app_cache.rb', line 34 def get_params vals = AppCache::SystemParam.get_params vals end |
.new(cache_type, options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/app_cache.rb', line 13 def new(cache_type, = {}) case cache_type when CACHE_TYPE_REDIS @storage = Redis.new(:url => [:url]) else @storage = AppCache::LocalFileCache.new([:file_path]) end #更新缓存 AppCache::SystemParam.cache_update end |
.sys_params_cache ⇒ Object
24 25 26 27 |
# File 'lib/app_cache.rb', line 24 def sys_params_cache h_params = AppCache::SystemParam.get_params_cache h_params end |
.sys_params_db ⇒ Object
29 30 31 32 |
# File 'lib/app_cache.rb', line 29 def sys_params_db h_params = AppCache::SystemParam.get_params_db h_params end |