module Elos::Index::Mappings

Public Instance Methods

field(name, type) click to toggle source
# File lib/elos/index/mappings.rb, line 9
def field(name, type)
  self.mappings_fields ||= {}
  mappings_fields[name] = send("#{type}_property")
end
mappings(mappings = nil) click to toggle source
# File lib/elos/index/mappings.rb, line 14
def mappings(mappings = nil)
  return self.given_mappings = mappings.is_a?(Proc) ? mappings.() : mappings.deep_dup if mappings
  self.set_mappings ||= Generator.generate(given_mappings, fields: mappings_fields, type_name: type_name, physically_destroyable: respond_to?(:physically_destroy?) && physically_destroy?)
end