Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
25 lines (20 sloc) 515 Bytes
module Friendly
class StorageFactory
attr_reader :table_klass, :index_klass, :cache_klass
def initialize(table_klass = DocumentTable, index_klass = Index,
cache_klass = Cache)
@table_klass = table_klass
@index_klass = index_klass
@cache_klass = cache_klass
end
def document_table(*args)
table_klass.new(*args)
end
def index(*args)
index_klass.new(*args)
end
def cache(*args)
cache_klass.cache_for(*args)
end
end
end