class Cachetastic::Connection include Singleton attr_accessor :connections def initialize self.connections = {} end def get(name) name = name.to_sym conn = self.connections[name] return conn if conn && conn.valid? store = Cachetastic::Stores::Base.get_options(name)["store"].camelcase conn = "Cachetastic::Stores::#{store}".constantize.new(name) self.connections[name] = conn return conn end end