Module: Estella::Searchable

Extended by:
ActiveSupport::Concern
Defined in:
lib/estella/searchable.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#as_indexed_json(_options = {}) ⇒ Object



52
53
54
55
# File 'lib/estella/searchable.rb', line 52

def as_indexed_json(_options = {})
  schema = self.class.indexed_json
  Hash[schema.keys.zip(schema.values.map { |v| v.respond_to?(:call) ? instance_exec(&v) : send(v) })]
end