Class: Indexes::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/indexes/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#hostsObject

Returns the value of attribute hosts.



4
5
6
# File 'lib/indexes/configuration.rb', line 4

def hosts
  @hosts
end

#logObject

Returns the value of attribute log.



4
5
6
# File 'lib/indexes/configuration.rb', line 4

def log
  @log
end

#traceObject

Returns the value of attribute trace.



4
5
6
# File 'lib/indexes/configuration.rb', line 4

def trace
  @trace
end

Instance Method Details

#analysis(&block) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/indexes/configuration.rb', line 18

def analysis(&block)
  if block_given?
    @analysis = { analysis: Dsl::Api.new(&block).to_h }
  else
    @analysis
  end
end

#computed_sort(name, &block) ⇒ Object



34
35
36
# File 'lib/indexes/configuration.rb', line 34

def computed_sort(name, &block)
  self.computed_sorts[name] = block
end

#computed_sortsObject



6
7
8
# File 'lib/indexes/configuration.rb', line 6

def computed_sorts
  @computed_sorts ||= {}
end

#mappings(&block) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/indexes/configuration.rb', line 10

def mappings(&block)
  if block_given?
    @mappings = Dsl::Mappings.new(&block).to_h
  else
    @mappings
  end
end

#suggestions(&block) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/indexes/configuration.rb', line 26

def suggestions(&block)
  if block_given?
    @suggestions = block
  else
    @suggestions
  end
end