Class: Cacheable::CacheConfiguration
- Inherits:
-
Object
- Object
- Cacheable::CacheConfiguration
- Defined in:
- lib/cache_configuration.rb
Constant Summary collapse
- @@cache_instance =
nil
- @@logger_instance =
nil
Class Method Summary collapse
Class Method Details
.cache ⇒ Object
31 32 33 34 |
# File 'lib/cache_configuration.rb', line 31 def self.cache load_config if @@cache_instance.nil? @@cache_instance end |
.environment ⇒ Object
25 26 27 28 29 |
# File 'lib/cache_configuration.rb', line 25 def self.environment Rails.env rescue => error 'test' end |
.load_config ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/cache_configuration.rb', line 17 def self.load_config configs = YAML.load_file("#{File.dirname(__FILE__)}/cache_configs.yml") env = environment @@cache_instance = eval(configs[env]['cache']) @@logger_instance = eval(configs[env]['logger']) end |
.logger ⇒ Object
36 37 38 39 |
# File 'lib/cache_configuration.rb', line 36 def self.logger load_config if @@logger_instance.nil? @@logger_instance end |