Module: AgnosticBackend::Indexable

Defined in:
lib/agnostic_backend/indexable/field.rb,
lib/agnostic_backend/indexable/config.rb,
lib/agnostic_backend/indexable/indexable.rb,
lib/agnostic_backend/indexable/field_type.rb,
lib/agnostic_backend/indexable/content_manager.rb,
lib/agnostic_backend/indexable/object_observer.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: CircularReferenceError, Config, ContentManager, Field, FieldType, ObjectObserver

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.includersObject (readonly)

Returns the value of attribute includers.



5
6
7
# File 'lib/agnostic_backend/indexable/indexable.rb', line 5

def includers
  @includers
end

Class Method Details

.included(base) ⇒ Object



12
13
14
15
16
17
# File 'lib/agnostic_backend/indexable/indexable.rb', line 12

def self.included(base)
  @includers ||= []
  @includers << base if @includers.none?{|klass| klass.name == base.name}
  base.send :include, InstanceMethods
  base.send :extend, ClassMethods
end

.indexable_class(index_name) ⇒ Object



7
8
9
# File 'lib/agnostic_backend/indexable/indexable.rb', line 7

def indexable_class(index_name)
  includers.find { |klass| klass.index_name == index_name }
end