Class: MethodCacher::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/method_cacher/base.rb

Overview

An object that holds configuration vars for MethodCacher

Instance Method Summary collapse

Instance Method Details

#caching_strategyObject



12
13
14
15
16
17
18
# File 'lib/method_cacher/base.rb', line 12

def caching_strategy
  if @caching_strategy
    @caching_strategy
  elsif defined? Rails
    Rails.cache  # default to the rails caching strategy if it's a Rails app
  end
end

#caching_strategy=(strategy) ⇒ Object



8
9
10
# File 'lib/method_cacher/base.rb', line 8

def caching_strategy= strategy
  @caching_strategy = strategy
end