class Twelvefactor::Environment::Cache::File

Public Class Methods

apply(app, cache_url) click to toggle source
# File lib/twelvefactor/environment/cache/file.rb, line 3
def self.apply app, cache_url
  config = app.config
  config.cache_store = :file_store, cache_url.path, options(cache_url.query)
end
options(query) click to toggle source
# File lib/twelvefactor/environment/cache/file.rb, line 8
def self.options query
  return {} unless query

  CGI
    .parse(query)
    .map { |k, val| [k.to_sym, val.first] }
    .to_h
end