Class: ThinkingSphinx::Index
- Inherits:
-
Object
- Object
- ThinkingSphinx::Index
- Defined in:
- lib/thinking_sphinx/index.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#reference ⇒ Object
readonly
Returns the value of attribute reference.
Class Method Summary collapse
Instance Method Summary collapse
- #indices ⇒ Object
-
#initialize(reference, options, &block) ⇒ Index
constructor
A new instance of Index.
Constructor Details
#initialize(reference, options, &block) ⇒ Index
Returns a new instance of Index.
12 13 14 15 16 17 18 |
# File 'lib/thinking_sphinx/index.rb', line 12 def initialize(reference, , &block) defaults = ThinkingSphinx::Configuration.instance. settings['index_options'] || {} defaults.symbolize_keys! @reference, @options, @block = reference, defaults.merge(), block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
4 5 6 |
# File 'lib/thinking_sphinx/index.rb', line 4 def block @block end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/thinking_sphinx/index.rb', line 4 def @options end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
4 5 6 |
# File 'lib/thinking_sphinx/index.rb', line 4 def reference @reference end |
Class Method Details
.define(reference, options = {}, &block) ⇒ Object
6 7 8 9 10 |
# File 'lib/thinking_sphinx/index.rb', line 6 def self.define(reference, = {}, &block) new(reference, , &block).indices.each do |index| ThinkingSphinx::Configuration.instance.indices << index end end |
Instance Method Details
#indices ⇒ Object
20 21 22 |
# File 'lib/thinking_sphinx/index.rb', line 20 def indices [:delta] ? delta_indices : [single_index] end |