Module: Arena::Cache
- Defined in:
- lib/arena/cache.rb,
lib/arena/cache/adaptor/null.rb,
lib/arena/cache/adaptor/rails.rb,
lib/arena/cache/adaptor/generic.rb,
lib/arena/cache/adaptor/padrino.rb
Defined Under Namespace
Modules: Adaptor
Class Method Summary collapse
- .adapt_to ⇒ Object
-
.method_missing(method, *args, &block) ⇒ Object
Delegate to the appropriate cache engine.
Class Method Details
.adapt_to ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/arena/cache.rb', line 8 def adapt_to if defined?(Rails) "Rails" elsif defined?(Padrino) "Padrino" else "Null" end end |
.method_missing(method, *args, &block) ⇒ Object
Delegate to the appropriate cache engine
20 21 22 |
# File 'lib/arena/cache.rb', line 20 def method_missing(method, *args, &block) "Arena::Cache::Adaptor::#{adapt_to}".constantize.send(method, *args, &block) end |