Class: Indexes::Configuration
- Inherits:
-
Object
- Object
- Indexes::Configuration
- Defined in:
- lib/indexes/configuration.rb
Instance Attribute Summary collapse
-
#hosts ⇒ Object
Returns the value of attribute hosts.
-
#log ⇒ Object
Returns the value of attribute log.
-
#trace ⇒ Object
Returns the value of attribute trace.
Instance Method Summary collapse
- #analysis(&block) ⇒ Object
- #computed_sort(name, &block) ⇒ Object
- #computed_sorts ⇒ Object
- #mappings(&block) ⇒ Object
- #suggestions(&block) ⇒ Object
Instance Attribute Details
#hosts ⇒ Object
Returns the value of attribute hosts.
4 5 6 |
# File 'lib/indexes/configuration.rb', line 4 def hosts @hosts end |
#log ⇒ Object
Returns the value of attribute log.
4 5 6 |
# File 'lib/indexes/configuration.rb', line 4 def log @log end |
#trace ⇒ Object
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_sorts ⇒ Object
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 |