Class: Ramaze::Cache
- Inherits:
-
Object
- Object
- Ramaze::Cache
- Defined in:
- lib/ramaze/cache.rb,
lib/ramaze/cache/lru.rb,
lib/ramaze/cache/redis.rb,
lib/ramaze/cache/moneta.rb,
lib/ramaze/cache/sequel.rb,
lib/ramaze/cache/memcache.rb
Overview
:nodoc:
Defined Under Namespace
Classes: LRU, MemCache, Moneta, Redis, Sequel
Class Method Summary collapse
-
.clear_after_reload ⇒ Object
Clears the cache after a file has been reloaded.
Instance Method Summary collapse
-
#initialize(name, klass = nil) ⇒ Cache
constructor
Overwrites Innate::Cache#initialize to make cache classes application aware.
Constructor Details
#initialize(name, klass = nil) ⇒ Cache
Overwrites Innate::Cache#initialize to make cache classes application aware. This prevents different applications running on the same host and user from overwriting eachothers data.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/ramaze/cache.rb', line 25 def initialize(name, klass = nil) @name = name.to_s.dup.freeze klass ||= [@name.to_sym] @instance = klass.new @instance.cache_setup( ENV['HOSTNAME'], ENV['USER'], Ramaze..app.name.to_s, @name ) end |
Class Method Details
.clear_after_reload ⇒ Object
Clears the cache after a file has been reloaded.
44 45 46 47 |
# File 'lib/ramaze/cache.rb', line 44 def self.clear_after_reload action.clear if respond_to?(:action) action_value.clear if respond_to?(:action_value) end |