Class: ElasticRecord::Index::Configurator

Inherits:
Object
  • Object
show all
Defined in:
lib/elastic_record/index/configurator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index) ⇒ Configurator

Returns a new instance of Configurator.



5
6
7
# File 'lib/elastic_record/index/configurator.rb', line 5

def initialize(index)
  @index = index
end

Instance Attribute Details

#indexObject (readonly)

Returns the value of attribute index.



4
5
6
# File 'lib/elastic_record/index/configurator.rb', line 4

def index
  @index
end

Instance Method Details

#property(name, options) ⇒ Object



9
10
11
# File 'lib/elastic_record/index/configurator.rb', line 9

def property(name, options)
  index.mapping[:properties][name.to_sym] = options
end