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.
10 11 12 13 14 15 16 |
# File 'lib/thinking_sphinx/index.rb', line 10 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.
2 3 4 |
# File 'lib/thinking_sphinx/index.rb', line 2 def block @block end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
2 3 4 |
# File 'lib/thinking_sphinx/index.rb', line 2 def @options end |
#reference ⇒ Object (readonly)
Returns the value of attribute reference.
2 3 4 |
# File 'lib/thinking_sphinx/index.rb', line 2 def reference @reference end |
Class Method Details
.define(reference, options = {}, &block) ⇒ Object
4 5 6 7 8 |
# File 'lib/thinking_sphinx/index.rb', line 4 def self.define(reference, = {}, &block) new(reference, , &block).indices.each do |index| ThinkingSphinx::Configuration.instance.indices << index end end |
Instance Method Details
#indices ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/thinking_sphinx/index.rb', line 18 def indices if [:delta] delta_indices else [single_index] end end |