Class: AgnosticBackend::Indexable::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/agnostic_backend/indexable/config.rb

Defined Under Namespace

Classes: ConfigEntry

Class Method Summary collapse

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, **options)
  indices[indexable_class.name] = ConfigEntry.new index_class, options
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.options)
end

.indicesObject



9
10
11
# File 'lib/agnostic_backend/indexable/config.rb', line 9

def self.indices
  @indices ||= {}
end