Class: FlyingSphinx::ConfigurationOptions
- Inherits:
-
Object
- Object
- FlyingSphinx::ConfigurationOptions
- Defined in:
- lib/flying_sphinx/configuration_options.rb
Instance Attribute Summary collapse
-
#engine ⇒ Object
readonly
Returns the value of attribute engine.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(raw = nil, version = nil) ⇒ ConfigurationOptions
constructor
A new instance of ConfigurationOptions.
- #settings ⇒ Object
- #version ⇒ Object
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
#engine ⇒ Object (readonly)
Returns the value of attribute engine.
2 3 4 |
# File 'lib/flying_sphinx/configuration_options.rb', line 2 def engine @engine end |
#raw ⇒ Object (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
#settings ⇒ Object
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 |
#version ⇒ Object
17 18 19 |
# File 'lib/flying_sphinx/configuration_options.rb', line 17 def version version_defined? ? configuration.version : @version end |