class ActiveSupport::Cache::BitzerStore

Constants

PROTECTED_METHODS
PUBLIC_METHODS
VERSION

Public Class Methods

new(config) click to toggle source
# File lib/active_support/cache/bitzer_store.rb, line 8
def initialize(config)
  raise ArgumentError, "BitzerStore needs default config. Supply a hash with a :default key." unless config.has_key?(:default)

  @flocks = {}
  config.each do |name, store_option|
    @flocks[name.to_sym] = ActiveSupport::Cache.lookup_store(store_option)
  end
end

Private Instance Methods

sheep(options) click to toggle source
# File lib/active_support/cache/bitzer_store.rb, line 29
def sheep(options)
  @flocks[sheep_name(options)] || @flocks[:default]
end
sheep_name(options) click to toggle source
# File lib/active_support/cache/bitzer_store.rb, line 33
def sheep_name(options)
  (options && options.is_a?(Hash) && options[:sheep].presence || :default).to_sym
end