class Faulty::Cache::Default

The default cache implementation

It tries to make a logical decision of what cache implementation to use based on the current environment.

Public Class Methods

new() click to toggle source
# File lib/faulty/cache/default.rb, line 16
def initialize
  @cache = if defined?(::Rails)
    Cache::Rails.new(::Rails.cache)
  elsif defined?(::ActiveSupport::Cache::MemoryStore)
    Cache::Rails.new(ActiveSupport::Cache::MemoryStore.new, fault_tolerant: true)
  else
    Cache::Null.new
  end
end