Class: Riddle::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/riddle/configuration.rb,
lib/riddle/configuration/index.rb,
lib/riddle/configuration/source.rb,
lib/riddle/configuration/indexer.rb,
lib/riddle/configuration/searchd.rb,
lib/riddle/configuration/section.rb,
lib/riddle/configuration/sql_source.rb,
lib/riddle/configuration/tsv_source.rb,
lib/riddle/configuration/xml_source.rb,
lib/riddle/configuration/remote_index.rb,
lib/riddle/0.9.9/configuration/searchd.rb,
lib/riddle/configuration/index_settings.rb,
lib/riddle/configuration/realtime_index.rb,
lib/riddle/configuration/template_index.rb,
lib/riddle/configuration/distributed_index.rb

Defined Under Namespace

Modules: IndexSettings Classes: ConfigurationError, DistributedIndex, Index, Indexer, Parser, RealtimeIndex, RemoteIndex, SQLSource, Searchd, Section, Source, TSVSource, TemplateIndex, XMLSource

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



30
31
32
33
34
35
# File 'lib/riddle/configuration.rb', line 30

def initialize
  @indexer = Riddle::Configuration::Indexer.new
  @searchd = Riddle::Configuration::Searchd.new
  @indices = []
  @sources = []
end

Instance Attribute Details

#indexerObject

Returns the value of attribute indexer.



24
25
26
# File 'lib/riddle/configuration.rb', line 24

def indexer
  @indexer
end

#indicesObject (readonly)

Returns the value of attribute indices.



23
24
25
# File 'lib/riddle/configuration.rb', line 23

def indices
  @indices
end

#searchdObject (readonly)

Returns the value of attribute searchd.



23
24
25
# File 'lib/riddle/configuration.rb', line 23

def searchd
  @searchd
end

#sourcesObject (readonly)

Returns the value of attribute sources.



23
24
25
# File 'lib/riddle/configuration.rb', line 23

def sources
  @sources
end

Class Method Details

.parse!(input) ⇒ Object



26
27
28
# File 'lib/riddle/configuration.rb', line 26

def self.parse!(input)
  Riddle::Configuration::Parser.new(input).parse!
end

Instance Method Details

#renderObject



37
38
39
40
41
42
43
# File 'lib/riddle/configuration.rb', line 37

def render
  (
    [@indexer.render, @searchd.render] +
    @sources.collect { |source| source.render } +
    @indices.collect { |index| index.render }
  ).join("\n")
end