class Arelastic::Mappings::Type

Attributes

type[R]
field[R]
options[R]

Public Class Methods

for_type(type) click to toggle source
# File lib/arelastic/mappings/type.rb, line 6
def for_type(type)
  @type = type
end
new(field, options = {}) click to toggle source
# File lib/arelastic/mappings/type.rb, line 12
def initialize(field, options = {})
  @field = field
  @options = options
end

Public Instance Methods

as_elastic() click to toggle source
# File lib/arelastic/mappings/type.rb, line 17
def as_elastic
  params = {'type' => self.class.type}.update(options)

  { field => params }
end