Sha256: 23b2f66cf92d2daf7145bd83c7f7589f45540708021297d2812870f6635e2fa7

Contents?: true

Size: 630 Bytes

Versions: 1

Compression:

Stored size: 630 Bytes

Contents

# frozen_string_literal: true

module Twelvefactor; end
module Twelvefactor::Environment; end
class Twelvefactor::Environment::Cache; end

require "twelvefactor/environment/cache/dalli"
require "twelvefactor/environment/cache/file"
require "twelvefactor/environment/cache/null"
require "twelvefactor/environment/cache/redis"

class Twelvefactor::Environment::Cache
  VERSION = "1.0.2".freeze

  HANDLERS = {
    "dalli" => Dalli,
    "file" => File,
    "null" => Null,
    "redis" => Redis
  }.freeze

  def self.apply app, cache_url
    handler = HANDLERS.fetch cache_url.scheme, Null
    handler.apply app, cache_url
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twelvefactor-cache-1.0.2 lib/twelvefactor/environment/cache.rb