Sha256: 3e3b8837a56b7eb24f1adee9b9da4e4cae9d9221c120b606e7cbe2a325684d72

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.3".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.3 lib/twelvefactor/environment/cache.rb