Class: AgnosticBackend::Indexable::Config
- Inherits:
-
Object
- Object
- AgnosticBackend::Indexable::Config
- Defined in:
- lib/agnostic_backend/indexable/config.rb
Defined Under Namespace
Classes: ConfigEntry
Class Method Summary collapse
- .configure_index(indexable_class, index_class, **options) ⇒ Object
- .create_index_for(indexable_class) ⇒ Object
- .indices ⇒ Object
Class Method Details
.configure_index(indexable_class, index_class, **options) ⇒ Object
13 14 15 |
# File 'lib/agnostic_backend/indexable/config.rb', line 13 def self.configure_index(indexable_class, index_class, **) indices[indexable_class.name] = ConfigEntry.new index_class, end |
.create_index_for(indexable_class) ⇒ Object
17 18 19 20 |
# File 'lib/agnostic_backend/indexable/config.rb', line 17 def self.create_index_for(indexable_class) entry = indices[indexable_class.name] entry.index_class.try(:new, indexable_class, entry.) end |
.indices ⇒ Object
9 10 11 |
# File 'lib/agnostic_backend/indexable/config.rb', line 9 def self.indices @indices ||= {} end |