Class: FlyingSphinx::ConfigurationOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/flying_sphinx/configuration_options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw = nil, version = nil) ⇒ ConfigurationOptions

Returns a new instance of ConfigurationOptions.


4
5
6
7
8
# File 'lib/flying_sphinx/configuration_options.rb', line 4

def initialize(raw = nil, version = nil)
  @raw     = raw || configuration.render
  @version = version || '2.2.11'
  @engine  = configuration.settings["engine"] || "sphinx"
end

Instance Attribute Details

#engineObject (readonly)

Returns the value of attribute engine.


2
3
4
# File 'lib/flying_sphinx/configuration_options.rb', line 2

def engine
  @engine
end

#rawObject (readonly)

Returns the value of attribute raw.


2
3
4
# File 'lib/flying_sphinx/configuration_options.rb', line 2

def raw
  @raw
end

Instance Method Details

#settingsObject


10
11
12
13
14
15
# File 'lib/flying_sphinx/configuration_options.rb', line 10

def settings
  @settings ||= begin
    configuration.render
    FlyingSphinx::SettingFiles.new(configuration).to_hash
  end
end

#versionObject


17
18
19
# File 'lib/flying_sphinx/configuration_options.rb', line 17

def version
  version_defined? ? configuration.version : @version
end