Class: Elasticated::Mapping::Fields::StandardField

Inherits:
Object
  • Object
show all
Defined in:
lib/elasticated/mapping/fields/standard_field.rb

Direct Known Subclasses

BooleanField, FieldWithDocValues

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ StandardField

Returns a new instance of StandardField.



11
12
13
# File 'lib/elasticated/mapping/fields/standard_field.rb', line 11

def initialize(name)
  self.name = name
end

Instance Attribute Details

#nameObject

abstract class child must implement ‘type()’



9
10
11
# File 'lib/elasticated/mapping/fields/standard_field.rb', line 9

def name
  @name
end

Instance Method Details

#buildObject



15
16
17
# File 'lib/elasticated/mapping/fields/standard_field.rb', line 15

def build
  { name => build_body }
end

#build_bodyObject



19
20
21
# File 'lib/elasticated/mapping/fields/standard_field.rb', line 19

def build_body
  { type: type }
end