Class: Friendly::StorageFactory
- Inherits:
-
Object
- Object
- Friendly::StorageFactory
- Defined in:
- lib/friendly/storage_factory.rb
Instance Attribute Summary (collapse)
-
- (Object) cache_klass
readonly
Returns the value of attribute cache_klass.
-
- (Object) index_klass
readonly
Returns the value of attribute index_klass.
-
- (Object) table_klass
readonly
Returns the value of attribute table_klass.
Instance Method Summary (collapse)
- - (Object) cache(*args)
- - (Object) document_table(*args)
- - (Object) index(*args)
-
- (StorageFactory) initialize(table_klass = DocumentTable, index_klass = Index, cache_klass = Cache)
constructor
A new instance of StorageFactory.
Constructor Details
- (StorageFactory) initialize(table_klass = DocumentTable, index_klass = Index, cache_klass = Cache)
A new instance of StorageFactory
5 6 7 8 9 10 |
# File 'lib/friendly/storage_factory.rb', line 5 def initialize(table_klass = DocumentTable, index_klass = Index, cache_klass = Cache) @table_klass = table_klass @index_klass = index_klass @cache_klass = cache_klass end |
Instance Attribute Details
- (Object) cache_klass (readonly)
Returns the value of attribute cache_klass
3 4 5 |
# File 'lib/friendly/storage_factory.rb', line 3 def cache_klass @cache_klass end |
- (Object) index_klass (readonly)
Returns the value of attribute index_klass
3 4 5 |
# File 'lib/friendly/storage_factory.rb', line 3 def index_klass @index_klass end |
- (Object) table_klass (readonly)
Returns the value of attribute table_klass
3 4 5 |
# File 'lib/friendly/storage_factory.rb', line 3 def table_klass @table_klass end |
Instance Method Details
- (Object) cache(*args)
20 21 22 |
# File 'lib/friendly/storage_factory.rb', line 20 def cache(*args) cache_klass.cache_for(*args) end |
- (Object) document_table(*args)
12 13 14 |
# File 'lib/friendly/storage_factory.rb', line 12 def document_table(*args) table_klass.new(*args) end |
- (Object) index(*args)
16 17 18 |
# File 'lib/friendly/storage_factory.rb', line 16 def index(*args) index_klass.new(*args) end |